8c10c4674d728dd3972ada3299491c9baf5d8ebe
[rrq/rrqforth.git] / adoc / p_realloc.adoc
1 // stdio.asm:   WORD p_realloc,'REALLOC',fasm
2
3 anchor:p_realloc[]
4
5 === Word: reALLOC
6
7 ....
8 Data stack: ( a m n -- a )
9 ....
10
11 "REALLOC" is a word that reallocates memory using mremap of address a
12 of size m to be size n bytes and returns the lowest address of the
13 allocated block.
14
15 Note that this makes new page allocations for the process from the
16 kernel, and the granularity is in pages, i.e. a multiple of 4 kb.
17
18 The memory is reampped using the MREMAP_MAYMOVE flag,
19
20 See also <<p_malloc,MALLOC>>