ludic.base: tb_reserve and imap_reserve size a table up front; HandlePool (a slot and a generation, nothing made after hd_pool_new, past its capacity a panic naming it); kept_push is the one declared grow, and every growth path left says its bound in @alloc_ok
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
f2dd27f443
commit
2d1d06899e
17 changed files with 199 additions and 26 deletions
|
|
@ -30,7 +30,7 @@ export function queue_new<T>(name: string) -> Queue<T> {
|
|||
}
|
||||
|
||||
export function q_push<T>(q: Queue<T>, v: T) -> void {
|
||||
push(q.items, v)
|
||||
kept_push(q.items, v)
|
||||
q.tag.pending = len(q.items)
|
||||
}
|
||||
|
||||
|
|
@ -65,7 +65,7 @@ export function q_unheld<T>(q: Queue<T>, pool: []T, out: []T) -> int {
|
|||
var held = false
|
||||
for j in 0 .. len(q.items) { if q.items[j] == r { held = true } }
|
||||
for j in 0 .. len(q.spare) { if q.spare[j] == r { held = true } }
|
||||
if not held { push(out, r) }
|
||||
if not held { kept_push(out, r) }
|
||||
}
|
||||
return len(out)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue