implemented realloc as well as a bunch of fixes and some small changes like changing the order of arguments for !, making alloc drop etc.

This commit is contained in:
IgorCielniak
2026-02-02 15:51:58 +01:00
parent ec826c31b2
commit 5ea020100e
9 changed files with 100 additions and 46 deletions

View File

@@ -66,7 +66,7 @@ end
word test-store
mem-slot dup
123 swap !
123 !
@ puti cr
end
@@ -80,7 +80,7 @@ word test-mmap
0 # offset
mmap
dup
1337 swap !
1337 !
dup
@ puti cr
4096 munmap drop
@@ -132,10 +132,10 @@ end
word test-struct
mem-slot
dup 111 swap Point.x!
dup 222 swap Point.y!
dup Point.x@ puti cr
Point.y@ puti cr
dup 111 ! # Point.x = 111
dup 8 + 222 ! # Point.y = 222
dup @ puti cr # print Point.x
dup 8 + @ puti cr # print Point.y
Point.size puti cr
end