dynamic-memory-here

Dynamic memory allocation in the data space region



[UNDEFINED] mresize [IF]

\ a one-stop shop of exception-throwing allocate/resize/free:
: mresize  ( a-addr1 u -- a-addr2 )
  over 0= if
    dup 0= if
      drop
    else
      nip allocate throw
    then
    exit
  then
  
  dup 0= if
    swap free throw
    exit
  then
  
  resize throw
;

[THEN]

by JimPeterson

avatar of JimPeterson

Versions

1.0.0

Download current as zip

Tags

forth-2012, memory, allocation

Dependencies

None

Dependents

None