Changeset View
Changeset View
Standalone View
Standalone View
head/libexec/rtld-elf/malloc.c
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | |||||
#include "rtld_printf.h" | #include "rtld_printf.h" | ||||
static void morecore(); | static void morecore(); | ||||
static int findbucket(); | static int findbucket(); | ||||
/* | /* | ||||
* Pre-allocate mmap'ed pages | * Pre-allocate mmap'ed pages | ||||
*/ | */ | ||||
#define NPOOLPAGES (32*1024/pagesz) | #define NPOOLPAGES (128*1024/pagesz) | ||||
static caddr_t pagepool_start, pagepool_end; | static caddr_t pagepool_start, pagepool_end; | ||||
static int morepages(); | static int morepages(); | ||||
/* | /* | ||||
* The overhead on a block is at least 4 bytes. When free, this space | * The overhead on a block is at least 4 bytes. When free, this space | ||||
* contains a pointer to the next free block, and the bottom two bits must | * contains a pointer to the next free block, and the bottom two bits must | ||||
* be zero. When in use, the first byte is set to MAGIC, and the second | * be zero. When in use, the first byte is set to MAGIC, and the second | ||||
* byte is the size index. The remaining bytes are for alignment. | * byte is the size index. The remaining bytes are for alignment. | ||||
▲ Show 20 Lines • Show All 418 Lines • Show Last 20 Lines |