fix missing file issue

FossilOrigin-Name: 14dfeec7f6a9e7b107784e82b545e705640b276a71a8a8d86f553d22637894fc
This commit is contained in:
crc 2022-07-26 22:15:49 +00:00
parent 678a16a65a
commit 3417d48ffb
4 changed files with 50 additions and 17 deletions

View file

@ -2,6 +2,18 @@
# Core Language
- new words
- n:add
- n:sub
- n:mul
- n:div
- n:divmod
- n:mod
- d:hash
- d:rehash
- d:Hash-Function
# VM
## nga-c
@ -10,6 +22,7 @@
- global state now in a struct
- minimal, functional FFI
- malloc/free support (from Rick C)
# Documentation
@ -17,3 +30,10 @@
# Examples
- port of retroforth/ilo block editor
----------------------------------------------------------------
Important notes:
- future releases will use 64-bit cells by default
----------------------------------------------------------------

View file

@ -19,12 +19,18 @@ Include compilation instructions and enable i/o devices.
~~~
'/*_Build_with_`cc_-lm_-O2_retro-unix.c_-o_retro`_*/ s:put nl nl
{ 'FLOATS
'#define_BIT64 s:put nl
{ 'CLOCK
'FILES
'UNIX
'FLOATS
'MALLOC
'MULTICORE
'RNG
'CLOCK
'SCRIPTING
'SIGNALS
'UNIX
'UNSIGNED
} [ '#define_ENABLE\_%s s:format s:put nl ] a:for-each nl
~~~

21
interface/malloc.retro Normal file
View file

@ -0,0 +1,21 @@
# Malloc
~~~
{{
:mem:invoke #15 io:scan-for io:invoke ;
#0 'ALLOC const
#1 'FREE const
#2 'STORE const
#3 'FETCH const
---reveal---
:mem:alloc (n--aa) ALLOC mem:invoke ;
:mem:set (an--) STORE mem:invoke ;
:mem:get (a--n) FETCH mem:invoke ;
:mem:free (aa--) FREE mem:invoke ;
}}
~~~

View file

@ -24,11 +24,6 @@
#include <time.h>
#include <unistd.h>
#ifdef ENABLE_TERMINAL
#include "linenoise.h"
#include "linenoise.c"
#endif
#ifdef ENABLE_SIGNALS
#include <signal.h>
#endif
@ -880,15 +875,6 @@ void io_filesystem(NgaState *vm) {
}
#ifdef ENABLE_TERMINAL
void query_terminal(NgaState *vm) {
}
void io_termina(NgaState *vm) {
}
#endif
#ifdef ENABLE_UNIX
/*---------------------------------------------------------------------
`unix_open_pipe()` is like `file_open()`, but for pipes. This pulls