diff options
| author | Thomas Vanbesien <tvanbesi@proton.me> | 2026-02-27 11:13:19 +0100 |
|---|---|---|
| committer | Thomas Vanbesien <tvanbesi@proton.me> | 2026-02-27 11:13:19 +0100 |
| commit | fb19b1c35f6ec52c075b214d2f0416900a7c1bbe (patch) | |
| tree | dd323940d5e60253e60626c5065393ad4ec3a24d /src/zone.c | |
| parent | 8849d801b9d3767390e3e1ed6b562db738ac1bcb (diff) | |
| download | malloc-fb19b1c35f6ec52c075b214d2f0416900a7c1bbe.tar.gz malloc-fb19b1c35f6ec52c075b214d2f0416900a7c1bbe.zip | |
Add chunk splitting and free-chunk search, use sysconf for page size
malloc now searches zones for a free chunk, splits it to the
requested aligned size, and allocates a new zone when none have
space. Replace getpagesize() with sysconf(_SC_PAGESIZE).
Diffstat (limited to 'src/zone.c')
| -rw-r--r-- | src/zone.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -16,7 +16,7 @@ _s_zone_size (size_t alloc_max) chunk_size = ALIGN (sizeof (t_chunk)) + ALIGN (alloc_max); total = ALIGN (sizeof (t_zone)) + MIN_ALLOC_COUNT * chunk_size; - page_size = (size_t)getpagesize (); + page_size = (size_t)sysconf (_SC_PAGESIZE); return ((total + page_size - 1) & ~(page_size - 1)); } |
