frame allocs (25.2): ludic.anim's quaternion scratch in its state's defaults, its skeleton scratch and missing-bone line declared; ludic.fishing's fact records made at the start (64) as the others'
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
8dfcccad41
commit
01d3aa725f
7 changed files with 23 additions and 11 deletions
|
|
@ -11,9 +11,24 @@ function fishing_fact_record(fishing_st: mut FishingState) -> FishingFact {
|
|||
fishing_st.fishing_fnext[0] += 1
|
||||
return f
|
||||
}
|
||||
return fishing_fact_more(fishing_st)
|
||||
}
|
||||
@alloc_ok("a new peak of facts held at once, past the 64 made at the start; kept and reused")
|
||||
function fishing_fact_more(fishing_st: mut FishingState) -> FishingFact {
|
||||
let f = new FishingFact
|
||||
push(fishing_st.fishing_fpool, f)
|
||||
return f
|
||||
}
|
||||
# the records made at the start, with a free list of room for them all
|
||||
function fishing_fpool_new() -> []FishingFact {
|
||||
let l = new []FishingFact
|
||||
for i in 0 .. 64 { push(l, new FishingFact) }
|
||||
return l
|
||||
}
|
||||
function fishing_ffree_new() -> []FishingFact {
|
||||
let l = fishing_fpool_new()
|
||||
List.clear(l)
|
||||
return l
|
||||
}
|
||||
# how many fact records have ever been made: the peak held at once, not the facts said
|
||||
export function fishing_fact_records(fishing_st: FishingState) -> int { return len(fishing_st.fishing_fpool) }
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@ export state FishingState {
|
|||
fishing_run_next: float = 0.0
|
||||
fishing_dice: Rng = null
|
||||
fishing_fact_q: Queue<FishingFact> = fishing_fact_q__new()
|
||||
fishing_fpool: []FishingFact = new []FishingFact # every fact record made, reused once no drain holds it (facts.ludic)
|
||||
fishing_ffree: []FishingFact = new []FishingFact
|
||||
fishing_fpool: []FishingFact = fishing_fpool_new() # every fact record made, reused once no drain holds it (facts.ludic)
|
||||
fishing_ffree: []FishingFact = fishing_ffree_new()
|
||||
fishing_fnext: []int = words(1)
|
||||
fishing_n: int = 0 # the record: caught, the biggest (cm), a legend landed
|
||||
fishing_big: int = 0
|
||||
|
|
|
|||
|
|
@ -268,6 +268,6 @@ program FishingTest {
|
|||
facts(fishing_st)
|
||||
}
|
||||
print(`fishing: 50 fish, {fishing_fact_records(fishing_st)} fact records made`)
|
||||
expect(fishing_fact_records(fishing_st) < 30)
|
||||
expect_eq(fishing_fact_records(fishing_st), 64)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue