Don't run out of memory from boxing objects in FFI

slava 2006-02-20 04:08:00 +00:00
parent 5c637e05f3
commit 3b2b86e1a2
5 changed files with 5 additions and 3 deletions

View File

@ -1,4 +1,3 @@
- out of memory from ffi calls
- update amd64 for %unbox-struct and callbacks
- clean up C stack frame assembly code to avoid moving spilled arguments
twice

View File

@ -64,4 +64,4 @@ M: alien-callback-error summary ( error -- )
] make-linear ;
M: alien-callback linearize* ( node -- )
dup linearize-callback linearize-next ;
compile-gc dup linearize-callback linearize-next ;

View File

@ -70,6 +70,7 @@ M: alien-invoke-error summary ( error -- )
] if ;
M: alien-invoke linearize* ( node -- )
compile-gc
dup alien-invoke-parameters objects>registers
dup alien-invoke-dlsym %alien-invoke ,
dup linearize-cleanup

View File

@ -59,3 +59,5 @@ kernel-internals math namespaces sequences words ;
: if-void ( type true false -- | false: type -- )
pick "void" = [ drop nip call ] [ nip call ] if ; inline
: compile-gc "maybe_gc" f %alien-invoke , ;

View File

@ -121,5 +121,5 @@ INLINE void* allot_object(CELL type, CELL length)
CELL collect_next(CELL scan);
void garbage_collection(CELL gen);
void primitive_gc(void);
void maybe_gc(CELL size);
DLLEXPORT void maybe_gc(CELL size);
void primitive_gc_time(void);