next up previous contents index
Next: 9.5.17 mem_lock: Lock access Up: 9.5 Memory Allocation Previous: 9.5.15 smemalignf: allocate aligned

9.5.16 morecore: add memory to malloc memory pool

   

SYNOPSIS

#include <oskit/c/malloc.h>

int morecore(size_t size);

DESCRIPTION

This routine is called directly or indirectly by any of the memory allocation routines in this section when a call to the underlying LMM allocation routine fails. This allows a kernel to add more memory to malloc_lmm as needed.

The default version of morecore in the minimal C library just returns zero indicating no more memory was available. Client OSes should override this routine as necessary.

PARAMETERS

size
Size in bytes of memory that should be addeed to malloc_lmm.

RETURNS

Returns non-zero if the indicated amount of memory was added, zero otherwise.



University of Utah Flux Research Group