Add new-generic ArrayList#449
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: daf2768064
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if nextFreeIndex + cap > JASS_MAX_ARRAY_SIZE | ||
| error("ArrayList: Storage limit exceeded for type") |
There was a problem hiding this comment.
Retry allocation after compacting free sections
When no single free section is large enough and the tail has no room, compactFreeList() can merge adjacent freed sections into a block that would satisfy cap, but this path immediately checks nextFreeIndex + cap again and errors without re-scanning the free list. For example, with live data near the array cap and two adjacent freed 3000-slot sections, a 5000-slot allocation still reports "Storage limit exceeded" even though compaction just created enough contiguous space.
Useful? React with 👍 / 👎.
| function clear() | ||
| size = 0 |
There was a problem hiding this comment.
Clear stale slots when shrinking the list
When clear() is used on a list that has held reference/handle values, it only sets size = 0; ondestroy later clears only 0..size-1, so all previously occupied slots remain referenced in the static backing store. This means the documented reuse pattern (temp.clear() in a loop) can keep stale unit/object references alive for the lifetime of the type storage instead of releasing them when the list is cleared.
Useful? React with 👍 / 👎.
No description provided.