[WIP] Mimalloc Integration - #212
Draft
elazaro-riverside wants to merge 58 commits into
Draft
Conversation
elazaro-riverside
force-pushed
the
mimalloc_integration
branch
from
June 5, 2026 17:01
440fb80 to
ccdece4
Compare
rjsmith1999
reviewed
Jun 9, 2026
| // * - size: number of bytes to copied | ||
| // * @return - pointer to the copied string | ||
| // * NOTE: Read this link to understand the nature of strdup & strndup | ||
| // * https://pubs.opengroup.org/onlineptrpubs/9699919799/functions/strdup.html |
Collaborator
There was a problem hiding this comment.
Seems like this change was unintentional...
elazaro-riverside
force-pushed
the
mimalloc_integration
branch
3 times, most recently
from
June 15, 2026 14:56
780db71 to
2c1e515
Compare
elazaro-riverside
force-pushed
the
mimalloc_integration
branch
from
June 18, 2026 18:21
1d190e8 to
71c28de
Compare
elazaro-riverside
force-pushed
the
mimalloc_integration
branch
from
June 30, 2026 17:37
288a716 to
d85f77d
Compare
added 20 commits
August 28, 2026 10:11
…odifications to the Dockerfile and cargo files to ensure mimalloc source is correctly linked with libresolve.
…cument workflow and after CI run.
…alloc archive to cargo so that downstream tests pass.
…see if it works correctly.
… compare the mimalloc approach to strict shadow object bounds approach.
…ncy. Added debugging statement and logic to use libc free if the allocation is not from mimalloc.
added 26 commits
August 28, 2026 10:33
…f the pointer is owned by a mimalloc allocation.
…to __resolve_free.
… the pointer is within a mimalloc-owned mem region.
…to return null pointers for pointers that are not allocated by mimalloc.
… in image-histogram is an interior pointer.
…nter originates from.
…ointer is within the region of mimalloc.
…he correct allocation size.
…egration to include Ryan's changes.
…mmented code from runtime functions, and adding info!() to debug allocation bounds returned from mimalloc.
elazaro-riverside
force-pushed
the
mimalloc_integration
branch
from
August 28, 2026 14:47
b69840e to
3345c24
Compare
Collaborator
Author
|
NOTE: Mimalloc cannot be mixed with other allocators. This includes external dependencies! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains changes to
libresolveto investigate alternative approaches to allocation metadata lookup. The motivation behind this change is to investigate the cost of retrieving metadata for registered dynamic allocations. The current lookup implementation searches aBTreeMapcontaining registered heap allocations. This lookup introduces overhead that can become significant in applications that perform frequent heap accesses or contain a large number of dynamic allocations.To mitigate this cost, we have started investigating approaches for reducing the overhead of allocation metadata lookups. The mimalloc allocator has excellent performance characteristics, and one of its notable properties is its ability to locate allocation metadata in O(1) time from an allocation address. At a high level, mimalloc organizes memory into segments, pages, and fixed-size blocks, allowing the page containg the pointer to be located directly from its address. The corresponding page metadata then provides information such as the page start address and block size, which can be used to determine the bounds of the allocation.