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
|
|
|
|
2024-09-09 20:07:02 +02:00
|
|
|
:mem:alloc (:n--a) ALLOC mem:invoke ;
|
|
|
|
:mem:store (:an--) STORE mem:invoke ;
|
|
|
|
:mem:fetch (:a--n) FETCH mem:invoke ;
|
|
|
|
:mem:free (:a--) FREE mem:invoke ;
|
|
|
|
:mem:resize (:an--) RESIZE mem:invoke ;
|
2022-07-27 00:15:49 +02:00
|
|
|
}}
|
|
|
|
|
2024-09-09 20:07:02 +02:00
|
|
|
:mem:cell+ (:nn-n) #8 * + ;
|
|
|
|
:mem:fetch-double (:n-nn)
|
2022-09-05 02:28:00 +02:00
|
|
|
dup #1 mem:cell+ fetch push mem:fetch pop ;
|
2024-09-09 20:07:02 +02:00
|
|
|
:mem:store-double (:ann-nn)
|
2022-08-31 04:06:30 +02:00
|
|
|
push push dup-pair #1 mem:cell+ pop mem:store pop mem:store ;
|
2022-07-27 00:15:49 +02:00
|
|
|
~~~
|