Barrelfish
Functions
oldsys_morecore.c File Reference

morecore() is a sbrk() equivalent. More...

Functions

Header * morecore (unsigned nu)
 sbrk() equivalent. More...
 
void lesscore (void)
 sbrk() garbage collector. More...
 

Detailed Description

morecore() is a sbrk() equivalent.

Function Documentation

void lesscore ( void  )

sbrk() garbage collector.

Tries to free up pages at the end of the segment, so to shorten the segment and return memory to the operating system.

Header* morecore ( unsigned  nu)

sbrk() equivalent.

This function tries to allocate at least the amount given by 'nu' in sizeof(::Header) byte units. In some cases, it will allocate less, if no more memory was available. In any case, It returns a pointer to the freelist header of the memory region. NULL is returned when out of memory.

Parameters
nuNumber of memory units (1 unit == sizeof(::Header) bytes)
Returns
Pointer to freelist header of new memory region or NULL on out of memory.