diff --git a/include/chibi/features.h b/include/chibi/features.h index 95ab9ca0..ae762fe4 100644 --- a/include/chibi/features.h +++ b/include/chibi/features.h @@ -91,12 +91,6 @@ /* and are thus thread-safe and independant. */ /* #define SEXP_USE_GLOBAL_HEAP 1 */ -/* uncomment this to make type definitions common to all contexts */ -/* By default types are only global if you don't allow user type */ -/* definitions, so new types will be local to a given set of */ -/* contexts sharing their heap. */ -/* #define SEXP_USE_GLOBAL_TYPES 1 */ - /* uncomment this to make the symbol table common to all contexts */ /* Will still be restricted to all contexts sharing the same */ /* heap, of course. */ @@ -336,10 +330,6 @@ #endif #endif -#ifndef SEXP_USE_GLOBAL_TYPES -#define SEXP_USE_GLOBAL_TYPES 0 -#endif - #ifndef SEXP_USE_GLOBAL_SYMBOLS #if SEXP_USE_BOEHM || SEXP_USE_MALLOC #define SEXP_USE_GLOBAL_SYMBOLS 1 diff --git a/include/chibi/sexp.h b/include/chibi/sexp.h index 60583cd5..3adc1ac1 100755 --- a/include/chibi/sexp.h +++ b/include/chibi/sexp.h @@ -864,20 +864,12 @@ SEXP_API sexp_heap sexp_global_heap; #define sexp_context_symbols(ctx) sexp_vector_data(sexp_global(ctx, SEXP_G_SYMBOLS)) #endif -#if SEXP_USE_GLOBAL_TYPES -SEXP_API struct sexp_type_struct *sexp_type_specs; -#define sexp_context_types(ctx) sexp_type_specs -#define sexp_type_by_index(ctx,i) (&(sexp_context_types(ctx)[i])) -#define sexp_context_num_types(ctx) sexp_num_types -#define sexp_context_type_array_size(ctx) sexp_type_array_size -#else #define sexp_context_types(ctx) sexp_vector_data(sexp_global(ctx, SEXP_G_TYPES)) #define sexp_type_by_index(ctx,i) (sexp_context_types(ctx)[i]) #define sexp_context_num_types(ctx) \ sexp_unbox_fixnum(sexp_global(ctx, SEXP_G_NUM_TYPES)) #define sexp_context_type_array_size(ctx) \ sexp_vector_length(sexp_global(ctx, SEXP_G_TYPES)) -#endif #define sexp_object_type(ctx,x) (sexp_type_by_index(ctx, ((x)->tag))) #define sexp_object_type_name(ctx,x) (sexp_type_name(sexp_object_type(ctx, x))) @@ -948,10 +940,8 @@ enum sexp_context_globals { #if ! SEXP_USE_GLOBAL_SYMBOLS SEXP_G_SYMBOLS, #endif -#if ! SEXP_USE_GLOBAL_TYPES SEXP_G_TYPES, SEXP_G_NUM_TYPES, -#endif SEXP_G_OOM_ERROR, /* out of memory exception object */ SEXP_G_OOS_ERROR, /* out of stack exception object */ SEXP_G_OPTIMIZATIONS, diff --git a/sexp.c b/sexp.c index 3ec003cd..a98af9e8 100755 --- a/sexp.c +++ b/sexp.c @@ -125,29 +125,16 @@ static struct sexp_type_struct _sexp_type_specs[] = { #endif }; -#if SEXP_USE_GLOBAL_TYPES -struct sexp_struct *sexp_type_specs = _sexp_type_specs; -#endif - #define SEXP_INIT_NUM_TYPES (SEXP_NUM_CORE_TYPES*2) #if SEXP_USE_TYPE_DEFS -#if SEXP_USE_GLOBAL_TYPES -static sexp_uint_t sexp_num_types = SEXP_NUM_CORE_TYPES; -static sexp_uint_t sexp_type_array_size = SEXP_NUM_CORE_TYPES; -#endif - sexp sexp_register_type_op (sexp ctx sexp_api_params(self, n), sexp name, sexp parent, sexp slots, sexp fb, sexp felb, sexp flb, sexp flo, sexp fls, sexp sb, sexp so, sexp sc, sexp w, sexp wb, sexp wo, sexp ws, sexp we, sexp_proc2 f) { -#if SEXP_USE_GLOBAL_TYPES - struct sexp_struct *new, *tmp; -#else sexp *v1, *v2; -#endif sexp_gc_var2(res, type); sexp_uint_t i, len, num_types=sexp_context_num_types(ctx), type_array_size=sexp_context_type_array_size(ctx); @@ -160,17 +147,6 @@ sexp sexp_register_type_op (sexp ctx sexp_api_params(self, n), sexp name, if (num_types >= type_array_size) { len = type_array_size*2; if (len > SEXP_MAXIMUM_TYPES) len = SEXP_MAXIMUM_TYPES; -#if SEXP_USE_GLOBAL_TYPES - new = malloc(len * sizeof(sexp_struct)); - for (i=0; i num_types) free(tmp); - sexp_type_array_size = len; -#else res = sexp_make_vector(ctx, sexp_make_fixnum(len), SEXP_VOID); if (sexp_exceptionp(res)) { sexp_gc_release2(ctx); @@ -181,11 +157,8 @@ sexp sexp_register_type_op (sexp ctx sexp_api_params(self, n), sexp name, for (i=0; ivalue), &(_sexp_type_specs[i]), sizeof(_sexp_type_specs[0])); vec[i] = type; } -#endif } #if ! SEXP_USE_GLOBAL_HEAP @@ -377,10 +342,8 @@ void sexp_destroy_context (sexp ctx) { if (sexp_context_heap(ctx)) { heap = sexp_context_heap(ctx); sexp_markedp(ctx) = 1; -#if ! SEXP_USE_GLOBAL_TYPES sexp_markedp(sexp_context_globals(ctx)) = 1; sexp_markedp(sexp_global(ctx, SEXP_G_TYPES)) = 1; -#endif sexp_sweep(ctx, &sum_freed); /* sweep w/o mark to run finalizers */ sexp_context_heap(ctx) = NULL; for ( ; heap; heap=tmp) {