Skip to content

posix_memalign fails when size and alignment is large #1304

Open
@Meandres

Description

@Meandres

posix_memalign() fails at the assertion that checks if the memory is aligned when calling it with an alignment bigger than the page size and a size bigger than 2088961.
I found out about this when trying to run https://github.com/ssvb/tinymembench, which, during the latency benchmark, allocates a 64MB region aligned to 4MB.
I managed to make this allocation work by changing the continuous flag to true in https://github.com/cloudius-systems/osv/blob/master/core/mempool.cc#L1854

Of course, posix_memalign does not have this problem on Linux. It might be quite a niche problem.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions