Skip to content

FEXCore/Utils: Implements a new atomic segmented bitmap allocator - #5815

Merged
lioncash merged 2 commits into
FEX-Emu:mainfrom
Sonicadvance1:198
Aug 12, 2026
Merged

FEXCore/Utils: Implements a new atomic segmented bitmap allocator #5815
lioncash merged 2 commits into
FEX-Emu:mainfrom
Sonicadvance1:198

Conversation

@Sonicadvance1

@Sonicadvance1 Sonicadvance1 commented Aug 7, 2026

Copy link
Copy Markdown
Member

This is tailored towards our needs for our JIT and eventually replacing
the linear allocator. Allowing us to reallocate memory for code blocks
that have been invalidated, letting us keep a single code buffer around
for longer and using less memory overall.

In particular, high-invalidation games that ship anti-tamper tend to
emit millions of ~128-byte blocks in just a handful of minutes which
causes our current linear allocator to consume gigabytes very quickly.
This will allow us to more aggressively reuse the allocation space and
reduce the memory load in those situations.

There's some additional resize tuning that needs some work whence it is
in situ which doesn't need to be done now.

@Sonicadvance1
Sonicadvance1 force-pushed the 198 branch 10 times, most recently from 355ced4 to b9eca66 Compare August 10, 2026 21:27

@lioncash lioncash left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just two nits, but overall looks good

Comment thread FEXCore/Source/Utils/atomic_segmented_bitmap_allocator.h Outdated
Comment thread FEXCore/Source/Utils/atomic_segmented_bitmap_allocator.h Outdated
Comment thread FEXCore/Source/Utils/atomic_segmented_bitmap_allocator.h
This is tailored towards our needs for our JIT and eventually replacing
the linear allocator. Allowing us to reallocate memory for code blocks
that have been invalidated, letting us keep a single code buffer around
for longer and using less memory overall.

In particular, high-invalidation games that ship anti-tamper tend to
emit millions of ~128-byte blocks in just a handful of minutes which
causes our current linear allocator to consume gigabytes very quickly.
This will allow us to more aggressively reuse the allocation space and
reduce the memory load in those situations.

There's some additional resize tuning that needs some work whence it is
in situ which doesn't need to be done now.
@lioncash
lioncash merged commit f386c62 into FEX-Emu:main Aug 12, 2026
13 checks passed
@Sonicadvance1
Sonicadvance1 deleted the 198 branch August 12, 2026 21:59
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.

2 participants