Skip to content

Add new-generic ArrayList#449

Open
Frotty wants to merge 5 commits into
masterfrom
array-list
Open

Add new-generic ArrayList#449
Frotty wants to merge 5 commits into
masterfrom
array-list

Conversation

@Frotty

@Frotty Frotty commented Jun 10, 2026

Copy link
Copy Markdown
Member

No description provided.

@Frotty

Frotty commented Jun 10, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread wurst/data/ArrayList.wurst Outdated
Comment on lines +145 to +146
if nextFreeIndex + cap > JASS_MAX_ARRAY_SIZE
error("ArrayList: Storage limit exceeded for type")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines +365 to +366
function clear()
size = 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant