|
@@ -73,12 +73,14 @@ void *sys_alloc(allocator_t *allocator, heap_t *heap, size_t size) {
|
|
|
|
|
|
if(allocation_size > allocator->remaining_size) {
|
|
|
#ifndef NO_SYSTEM_CALLS
|
|
|
- // TODO Make the page size configurable at design time
|
|
|
- if(allocation_size < 4096) {
|
|
|
- allocation_size = 4096;
|
|
|
+ if(allocation_size < SYS_ALLOC_SIZE) {
|
|
|
+ allocation_size = SYS_ALLOC_SIZE;
|
|
|
} else {
|
|
|
- /* If allocation size is more than 4k, then request multiples of 4k */
|
|
|
- allocation_size = ((size + HEADER_SIZE) / 4096 + 1) * 4096;
|
|
|
+ /* If allocation size is more than the default size, then request
|
|
|
+ * multiples of it.
|
|
|
+ */
|
|
|
+ allocation_size = ((size + HEADER_SIZE) / SYS_ALLOC_SIZE + 1) *
|
|
|
+ SYS_ALLOC_SIZE;
|
|
|
}
|
|
|
#ifdef WITH_MMAP
|
|
|
if(dev_zero_fd < 0) {
|