mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 05:39:18 +02:00
Adding option to disable automatic running of finalizers altogether.
This commit is contained in:
parent
4527c772c5
commit
6db194171e
4 changed files with 16 additions and 0 deletions
2
gc.c
2
gc.c
|
@ -322,6 +322,7 @@ void sexp_reset_weak_references(sexp ctx) {
|
|||
#define sexp_reset_weak_references(ctx)
|
||||
#endif
|
||||
|
||||
#if SEXP_USE_FINALIZERS
|
||||
sexp sexp_finalize (sexp ctx) {
|
||||
size_t size;
|
||||
sexp p, t, end;
|
||||
|
@ -368,6 +369,7 @@ sexp sexp_finalize (sexp ctx) {
|
|||
#endif
|
||||
return sexp_make_fixnum(finalize_count);
|
||||
}
|
||||
#endif
|
||||
|
||||
sexp sexp_sweep (sexp ctx, size_t *sum_freed_ptr) {
|
||||
size_t freed, max_freed=0, sum_freed=0, size;
|
||||
|
|
|
@ -84,6 +84,11 @@
|
|||
/* go away and you're not working on your own C extension. */
|
||||
/* #define SEXP_USE_CONSERVATIVE_GC 1 */
|
||||
|
||||
/* uncomment this to disable automatic running of finalizers */
|
||||
/* You will need to close ports and file descriptors manually */
|
||||
/* (as you should anyway) and some C extensions may break. */
|
||||
/* #define SEXP_USE_FINALIZERS 0 */
|
||||
|
||||
/* uncomment this to add additional native checks to only mark objects in the heap */
|
||||
/* #define SEXP_USE_SAFE_GC_MARK 1 */
|
||||
|
||||
|
@ -387,6 +392,10 @@
|
|||
#define SEXP_USE_CONSERVATIVE_GC 0
|
||||
#endif
|
||||
|
||||
#ifndef SEXP_USE_FINALIZERS
|
||||
#define SEXP_USE_FINALIZERS 1
|
||||
#endif
|
||||
|
||||
#ifndef SEXP_USE_TRACK_ALLOC_SOURCE
|
||||
#define SEXP_USE_TRACK_ALLOC_SOURCE SEXP_USE_DEBUG_GC > 2
|
||||
#endif
|
||||
|
|
|
@ -1522,7 +1522,11 @@ SEXP_API int sexp_grow_heap (sexp ctx, size_t size, size_t chunk_size);
|
|||
SEXP_API sexp_heap sexp_make_heap (size_t size, size_t max_size, size_t chunk_size);
|
||||
SEXP_API void sexp_mark (sexp ctx, sexp x);
|
||||
SEXP_API sexp sexp_sweep (sexp ctx, size_t *sum_freed_ptr);
|
||||
#if SEXP_USE_FINALIZERS
|
||||
SEXP_API sexp sexp_finalize (sexp ctx);
|
||||
#else
|
||||
#define sexp_finalize(ctx) SEXP_ZERO
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if SEXP_USE_GLOBAL_HEAP
|
||||
|
|
|
@ -5,6 +5,7 @@ CPPFLAGS=-DSEXP_USE_SIMPLIFY=0
|
|||
CPPFLAGS=-DSEXP_USE_TYPE_DEFS=0
|
||||
SEXP_USE_BOEHM=1;CPPFLAGS=-I/opt/local/include;LDFLAGS=-L/opt/local/lib
|
||||
CPPFLAGS=-DSEXP_USE_DEBUG_GC=1
|
||||
CPPFLAGS=-DSEXP_USE_FINALIZERS=0
|
||||
CPPFLAGS=-DSEXP_USE_CONSERVATIVE_GC=1
|
||||
CPPFLAGS=-DSEXP_USE_GLOBAL_HEAP=1
|
||||
CPPFLAGS=-DSEXP_USE_GLOBAL_SYMBOLS=1
|
||||
|
|
Loading…
Add table
Reference in a new issue