# pGetPool

Syntax: | Copy
    #ilASM{
        [32]
            mov ecx,<required size in bytes>
            mov edx,<era>
        [64]
            mov rcx,<required size in bytes>
            mov rdx,<era>
        []
            call :%pGetPool
          }
Description: | Internal routine to obtain raw memory, intended for use by the likes of pAllocStr, pAllocSeq, pStoreFlt, pStoreMint, pStack, and pAlloc. The latter (the hll allocate() function) is in fact just a slim wrapper that remembers the actual size yielded, as needed for pFreePool. The era, or effective return address, is the value which is translated to a line number when reporting a fatal error. Obviously it is much better to report errors on a line such as `s[i] = x` in preference to a `call :%pGetPool` in pAllocStr etc, and to complicate matters further, the era should be that of say the call to :%opConcat rather than the call of :%pAllocStr within that function. Any such errors should only occur after a rogue poke, incorrect memory allocation size, or similar. Can return 0, which should be fatal for everything except allocate(). Returned memory contains whatever garbage was already there.
On return: | [32] eax is raw pointer, edx is allocated size, all other registers (except ebx/ebp/esp) trashed [64] rax is raw pointer, rdx is allocated size, all other registers (except rbx/rbp/rsp) trashed
Defined in: | builtins\VM\pHeap.e