frame allocs (25.2): physics, npc, vehicles and wildlife's bounded growth declared - id tables to their most, a walker slot, a guest's copies, a player's own vehicle, a table at a load
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
082fd26bf1
commit
34664e867f
7 changed files with 8 additions and 0 deletions
|
|
@ -10,6 +10,7 @@ function ph_keep(physics_st: mut PhysicsState, s: pointer) -> int {
|
|||
physics_st.ph_shapes[id] = s
|
||||
return id
|
||||
}
|
||||
@alloc_ok("the id table grows to the most shapes held at once; a freed id is handed out again")
|
||||
push(physics_st.ph_shapes, s)
|
||||
return len(physics_st.ph_shapes) - 1
|
||||
}
|
||||
|
|
@ -26,6 +27,7 @@ export function phys_shape_free(physics_st: mut PhysicsState, id: int) -> void {
|
|||
if s == null { return }
|
||||
jph_shape_free(s)
|
||||
physics_st.ph_shapes[id] = null
|
||||
@alloc_ok("the spare ids, no more than the most shapes ever held")
|
||||
push(physics_st.ph_spare, id)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue