Skip to content

Make allocations < 16 bytes more space efficient #1011

@wkozaczuk

Description

@wkozaczuk

The malloc family calls requesting less than 16 bytes end up allocating full page (4K) for each call. This is very wasteful and can be easily fixed by tweaking if/else condition in here.

Notes from @Nadav - "When size is tiny, we anyway allocate not "size" but rather memory::pool::min_object_size (see the "max" code below), so we need the alignment to be less than that, not the size."

This issue is discussed in more detail in this mailing group email.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions