Optimize memory layout

This commit is contained in:
Justine Tunney 2022-09-12 04:19:32 -07:00
parent 0305194d98
commit b69f3d2488
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
41 changed files with 383 additions and 347 deletions

View file

@ -20,7 +20,10 @@
#include "libc/mem/mem.h"
/**
* Equivalent to memalign(PAGESIZE, ROUNDUP(n, PAGESIZE)).
* Allocates granular aligned memory of granular size, i.e.
*
* memalign(sysconf(_SC_PAGESIZE),
* ROUNDUP(n, sysconf(_SC_PAGESIZE)));
*
* @param n number of bytes needed
* @return memory address, or NULL w/ errno
@ -28,5 +31,5 @@
* @threadsafe
*/
void *pvalloc(size_t n) {
return memalign(PAGESIZE, ROUNDUP(n, PAGESIZE));
return memalign(FRAMESIZE, ROUNDUP(n, FRAMESIZE));
}