Download c-reference/deque.h from Snapkitty/sparse-router-formal: direct link, hf CLI and curl.
- Browser
- Download file 966 Bytes
-
https://huggingface.co/Snapkitty/sparse-router-formal/resolve/main/c-reference/deque.h
- Command line
-
hf download hf://Snapkitty/sparse-router-formal/c-reference/deque.h
-
curl -L -o deque.h https://huggingface.co/Snapkitty/sparse-router-formal/resolve/main/c-reference/deque.h
966 Bytes
| /* SPDX-License-Identifier: LicenseRef-Sovereign-Leviathan-SL-AGPL3-001 | |
| * Copyright (C) 2026 SNAPKITTYWEST / Sovereign Kernel Project | |
| * CLONE_GATE: sparse-router-formal::deque | |
| */ | |
| static inline bool deque_push(work_deque_t *d, const task_t *t) { | |
| if (d->count >= DEQUE_CAPACITY) return false; | |
| d->tasks[d->tail] = *t; | |
| d->tail = (d->tail + 1) % DEQUE_CAPACITY; | |
| d->count++; | |
| return true; | |
| } | |
| static inline bool deque_pop(work_deque_t *d, task_t *out) { | |
| if (d->count == 0) return false; | |
| d->count--; | |
| d->tail = (d->tail == 0) ? DEQUE_CAPACITY - 1 : d->tail - 1; | |
| *out = d->tasks[d->tail]; | |
| return true; | |
| } | |
| static inline bool deque_steal(work_deque_t *d, task_t *out) { | |
| if (d->count == 0) return false; | |
| *out = d->tasks[d->head]; | |
| d->head = (d->head + 1) % DEQUE_CAPACITY; | |
| d->count--; | |
| return true; | |
| } | |