Skip to content

Dedicated nursery memory area#1861

Draft
timo wants to merge 4 commits into
mainfrom
dedicated_nursery_memory_area
Draft

Dedicated nursery memory area#1861
timo wants to merge 4 commits into
mainfrom
dedicated_nursery_memory_area

Conversation

@timo

@timo timo commented Nov 15, 2024

Copy link
Copy Markdown
Member

This feature reserves a big virtual memory area during startup (0x40000000 bytes, so 1 gigabyte. this should maybe be more, since virtual memory is essentially free) and gives it to mimalloc for use to allocate nurseries in.

This lets us check very cheaply if a pointer points into a nursery, or somewhere else. Most importantly, checking if an object is in generation two now becomes a simple bounds check on the pointer (plus check if the feature is currently in use, since the virtual memory reservation at the start can fail) instead of having to follow the pointer which is not guaranteed to hit the processor cache (especially in a minor gc collection run).

@coke coke force-pushed the dedicated_nursery_memory_area branch from 05ef27b to c970e28 Compare June 3, 2026 13:11
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