Skip to content

update MD_ArenaDefault current pointer in MD_ArenaDefaultPush after allocating new arena#22

Open
chitatof wants to merge 1 commit into
ryanfleury:masterfrom
chitatof:master
Open

update MD_ArenaDefault current pointer in MD_ArenaDefaultPush after allocating new arena#22
chitatof wants to merge 1 commit into
ryanfleury:masterfrom
chitatof:master

Conversation

@chitatof

Copy link
Copy Markdown

I'm not familiar with this codebase, I was just looking at the arena implementation, so excuse me if this is not correct, but I believe it's intended that the "current" pointer is updated after adding a new arena to the linked list, which would be congruent with MD_ArenaDefaultPopTo behaviour.

@jagt

jagt commented Dec 26, 2024

Copy link
Copy Markdown

I'm having exactly the same confusion. I assume with this change it would be the correct behavior. The default reserve size is 64mb that's large enough that the issue don't usually occur.

I took a look at raddebugger's arena impl and it's similar to this, there's indeed a line matching this change that moves the current pointer.

See https://github.com/EpicGamesExt/raddebugger/blob/aa42d12d0fe58409d52cbc950cb5e44f3a668e29/src/base/base_arena.c#L130

@KobeDB

KobeDB commented Sep 1, 2025

Copy link
Copy Markdown

I also ran into this bug while doing some allocation-heavy workloads with this arena implementation. Applying chitatof's fix solved it for me!

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.

3 participants