diff --git a/include/chibi/features.h b/include/chibi/features.h index 2a0f52f7..3d18b43b 100644 --- a/include/chibi/features.h +++ b/include/chibi/features.h @@ -293,7 +293,7 @@ #endif #ifndef SEXP_USE_WEAK_REFERENCES -#define SEXP_USE_WEAK_REFERENCES 1 +#define SEXP_USE_WEAK_REFERENCES ! SEXP_USE_NO_FEATURES #endif #ifndef SEXP_USE_MALLOC diff --git a/include/chibi/sexp.h b/include/chibi/sexp.h index f96be078..60583cd5 100755 --- a/include/chibi/sexp.h +++ b/include/chibi/sexp.h @@ -865,7 +865,7 @@ SEXP_API sexp_heap sexp_global_heap; #endif #if SEXP_USE_GLOBAL_TYPES -SEXP_API struct sexp_struct *sexp_type_specs; +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 diff --git a/sexp.c b/sexp.c index 1e53a6ba..b4255f5d 100755 --- a/sexp.c +++ b/sexp.c @@ -161,9 +161,11 @@ sexp sexp_register_type_op (sexp ctx sexp_api_params(self, n), sexp name, len = type_array_size*2; if (len > SEXP_MAXIMUM_TYPES) len = SEXP_MAXIMUM_TYPES; #if SEXP_USE_GLOBAL_TYPES - new = malloc(len * sizeof(_sexp_type_specs[0])); - for (i=0; i num_types) free(tmp);