Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust memory pressure for Unsafe.allocateMemory #354

Merged
merged 3 commits into from
Jun 8, 2023
Merged

Conversation

wasabii
Copy link
Contributor

@wasabii wasabii commented Jun 7, 2023

System.GC.AddMemoryPressure and System.GC.RemoveMemoryPressure should be updated when Unsafe.allocateMemory is called, Unsafe.reallocateMemory and Unsafe.freeMemory().

We do this by storing an sizeof(IntPtr) header at the beginning of the allocate block of memory, so we can record the original length to remove upon deallocation.

…the original size. Add GC pressure on allocation, Do the same on reallocate.#
@wasabii wasabii merged commit 6227db7 into develop Jun 8, 2023
68 checks passed
@wasabii wasabii deleted the feature/mempres branch June 8, 2023 02:01
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.

None yet

1 participant