microsoft / microsoft/mimalloc

Return usable allocation size on allocation

Open
#2 6 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
13.4k
Forks
1.2k
Avg merge
4d 45m
Merged PRs (30d)
13

Description

jemalloc provides smallocx (e.g. see implementation here: https://github.com/jemalloc/jemalloc/blob/dev/src/jemalloc.c#L3015), which not only returns a pointer to the allocation, but also the size of the allocation size class (that is , the usable allocation size).

It would be nice if for all allocating and resizing operations a similar API could be provided, so that users that might want to use all usable space don't have to query the size class.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading jemalloc's src/jemalloc.c implementation of smallocx linked in the issue, then compare its usable-size return with mimalloc's allocation and resizing APIs. Define the affected allocating and resizing operations and verify that the proposed API exposes usable allocation size consistently; the issue does not name repository files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.