diff --git a/kernel/dlmalloc/dlmalloc_port.inc b/kernel/dlmalloc/dlmalloc_port.inc index 2e4613a..fe53949 100644 --- a/kernel/dlmalloc/dlmalloc_port.inc +++ b/kernel/dlmalloc/dlmalloc_port.inc @@ -68,6 +68,6 @@ void *sbrk(long inc) { uint64_t blocks = _DIV_ROUNDUP(inc, BITMAP_BLOCK_SIZE); uint8_t *virt = VIRT(pmm_alloc(blocks)); hal_memset(virt, 0, blocks * BITMAP_BLOCK_SIZE); - _last = (void *)(virt + inc); + _last = (void *)(virt + (blocks * BITMAP_BLOCK_SIZE)); return virt; }