core: remove the "small-cons" feature and build flag

This commit is contained in:
Daniel Kochmański 2024-12-06 13:04:34 +00:00
parent a08d60d11a
commit 31fdffa6ab
8 changed files with 4 additions and 89 deletions

View file

@ -53,6 +53,8 @@
- Update bundled libgc-8.2.4 to libgc-8.2.8.
- Remove the feature "small cons" and its build flags
* 24.5.10 changes since 23.9.9
** Announcement
Dear Community,

View file

@ -374,16 +374,10 @@ ecl_cons(cl_object a, cl_object d)
ecl_disable_interrupts_env(the_env);
obj = GC_MALLOC(sizeof(struct ecl_cons));
ecl_enable_interrupts_env(the_env);
#ifdef ECL_SMALL_CONS
obj->car = a;
obj->cdr = d;
return ECL_PTR_CONS(obj);
#else
obj->t = t_list;
obj->car = a;
obj->cdr = d;
return (cl_object)obj;
#endif
}
cl_object

5
src/configure vendored
View file

@ -7380,11 +7380,6 @@ printf "%s\n" "#define ECL_EXTERNALIZABLE /**/" >>confdefs.h
fi
fi
if test ${enable_smallcons} = "yes" ; then
printf "%s\n" "#define ECL_SMALL_CONS /**/" >>confdefs.h
fi

View file

@ -605,9 +605,6 @@ if test ${enable_boehm} = "no" ; then
else
ECL_BOEHM_GC
fi
if test ${enable_smallcons} = "yes" ; then
AC_DEFINE([ECL_SMALL_CONS], [], [ECL_SMALL_CONS])
fi
ECL_LIBFFI

View file

@ -63,35 +63,6 @@ type of object. For instance, a cons cell consists of three words:
+--------------------+
@end verbatim
@cfindex --enable-small-cons [YES|no]
Note, that this is one of the possible implementation of
@code{cons}. The second one (currently default) uses the immediate value
for the @code{list} and consumes two words instead of three. Such
implementation is more memory and speed efficient (according to the
comments in the source code):
@verbatim
/*
* CONSES
*
* We implement two variants. The "small cons" type carries the type
* information in the least significant bits of the pointer. We have
* to do some pointer arithmetics to find out the CAR / CDR of the
* cons but the overall result is faster and memory efficient, only
* using two words per cons.
*
* The other scheme stores conses as three-words objects, the first
* word carrying the type information. This is kept for backward
* compatibility and also because the oldest garbage collector does
* not yet support the smaller datatype.
*
* To make code portable and independent of the representation, only
* access the objects using the common macros below (that is all
* except ECL_CONS_PTR or ECL_PTR_CONS).
*/
@end verbatim
@cppdef cl_object
@deftp @cind{} cl_object
This is the type of a lisp object. For your C/C++ program, a cl_object

View file

@ -48,9 +48,6 @@
/* ECL_SIGNED_ZERO */
#undef ECL_SIGNED_ZERO
/* ECL_SMALL_CONS */
#undef ECL_SMALL_CONS
/* ECL_SSE2 */
#undef ECL_SSE2

View file

@ -206,9 +206,6 @@ typedef unsigned char ecl_base_char;
/* do we want NaNs and Infs */
#undef ECL_IEEE_FP
/* We can use small, two-words conses, without type information */
#undef ECL_SMALL_CONS
/* Do we use C or C++ compiler to compile ecl? */
#undef ECL_CXX_CORE

View file

@ -331,43 +331,8 @@ enum {
ECL_INHERITED
};
/*
* CONSES
*
* We implement two variants. The "small cons" type carries the type
* information in the least significant bits of the pointer. We have
* to do some pointer arithmetics to find out the CAR / CDR of the
* cons but the overall result is faster and memory efficient, only
* using two words per cons.
*
* The other scheme stores conses as three-words objects, the first
* word carrying the type information. This is kept for backward
* compatibility and also because the oldest garbage collector does
* not yet support the smaller datatype.
*
* To make code portable and independent of the representation, only
* access the objects using the common macros below (that is all
* except ECL_CONS_PTR or ECL_PTR_CONS).
*/
/* CONSES */
#ifdef ECL_SMALL_CONS
#define ECL_LISTP(x) (ECL_IMMEDIATE(x) == t_list)
#define ECL_CONSP(x) (LISTP(x) && !Null(x))
#define ECL_ATOM(x) (Null(x) || !LISTP(x))
#define ECL_SYMBOLP(x) (Null(x) || ((ECL_IMMEDIATE(x) == 0) && ((x)->d.t == t_symbol)))
#define ECL_PTR_CONS(x) (cl_object)((char*)(x) + t_list)
#define ECL_CONS_PTR(x) ((struct ecl_cons *)((char *)(x) - t_list))
#define ECL_CONS_CAR(x) (*(cl_object*)((char *)(x) - t_list))
#define ECL_CONS_CDR(x) (*(cl_object*)((char *)(x) + sizeof(cl_object) - t_list))
#define ECL_RPLACA(x,v) (ECL_CONS_CAR(x)=(v))
#define ECL_RPLACD(x,v) (ECL_CONS_CDR(x)=(v))
struct ecl_cons {
cl_object car; /* car */
cl_object cdr; /* cdr */
};
#else
#define ECL_LISTP(x) (ECL_IMMEDIATE(x)? Null(x) : ((x)->d.t == t_list))
#define ECL_CONSP(x) ((ECL_IMMEDIATE(x) == 0) && ((x)->d.t == t_list))
#define ECL_ATOM(x) (ECL_IMMEDIATE(x) || ((x)->d.t != t_list))
@ -383,7 +348,6 @@ struct ecl_cons {
cl_object car; /* car */
cl_object cdr; /* cdr */
};
#endif
enum ecl_httest { /* hash table key test function */
ecl_htt_eq, /* eq */
@ -1124,9 +1088,7 @@ struct ecl_sse_pack {
Definition of lispunion.
*/
union cl_lispunion {
#ifndef ECL_SMALL_CONS
struct ecl_cons cons; /* unoptimized cons */
#endif
struct ecl_cons cons; /* cons */
struct ecl_bignum big; /* bignum */
struct ecl_ratio ratio; /* ratio */
struct ecl_singlefloat SF; /* single floating-point number */