Function ralloc_shim::config::extra_brk [] [src]

pub fn extra_brk(size: usize) -> usize

Canonicalize a BRK request.

Syscalls can be expensive, which is why we would rather accquire more memory than necessary, than having many syscalls acquiring memory stubs. Memory stubs are small blocks of memory, which are essentially useless until merge with another block.

To avoid many syscalls and accumulating memory stubs, we BRK a little more memory than necessary. This function calculate the memory to be BRK'd based on the necessary memory.

The return value specifies how much more space is requested.