mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-22 21:32:31 +00:00
Optimize memory layout
This commit is contained in:
parent
0305194d98
commit
b69f3d2488
41 changed files with 383 additions and 347 deletions
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue