2022-07-27 00:15:49 +02:00
|
|
|
# Malloc
|
|
|
|
|
|
|
|
~~~
|
|
|
|
|
|
|
|
{{
|
|
|
|
:mem:invoke #15 io:scan-for io:invoke ;
|
|
|
|
|
2022-07-27 11:57:31 +02:00
|
|
|
#0 'ALLOC const
|
|
|
|
#1 'FREE const
|
|
|
|
#2 'STORE const
|
|
|
|
#3 'FETCH const
|
|
|
|
#4 'RESIZE const
|
2022-07-27 00:15:49 +02:00
|
|
|
|
2022-07-27 11:57:31 +02:00
|
|
|
---reveal---
|
2022-07-27 00:15:49 +02:00
|
|
|
|
2022-07-27 11:57:31 +02:00
|
|
|
:mem:alloc (n--aa) ALLOC mem:invoke ;
|
2022-08-08 18:04:29 +02:00
|
|
|
:mem:store (an--) STORE mem:invoke ;
|
|
|
|
:mem:fetch (a--n) FETCH mem:invoke ;
|
2022-07-27 11:57:31 +02:00
|
|
|
:mem:free (aa--) FREE mem:invoke ;
|
|
|
|
:mem:resize (aan--) RESIZE mem:invoke ;
|
2022-07-27 00:15:49 +02:00
|
|
|
}}
|
|
|
|
|
2022-08-22 11:26:07 +02:00
|
|
|
:mem:cell+ (nnn-n) #4 * + ;
|
|
|
|
:mem:fetch-double (n-nn)
|
|
|
|
dup-pair #1 mem:cell+ fetch push mem:fetch pop ;
|
2022-07-27 00:15:49 +02:00
|
|
|
~~~
|