ecl_list1: redefine as a preprocessor macro

This is the same as ecl_cons for all practical purposes so we simply put a
define `#define ecl_list1(x) ecl_cons(x, ECL_NIL)`.
This commit is contained in:
Daniel Kochmański 2022-11-19 12:40:18 +01:00
parent 93fabac00a
commit e53b3d14bd
2 changed files with 1 additions and 21 deletions

View file

@ -387,26 +387,6 @@ ecl_cons(cl_object a, cl_object d)
#endif
}
cl_object
ecl_list1(cl_object a)
{
const cl_env_ptr the_env = ecl_process_env();
struct ecl_cons *obj;
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 = ECL_NIL;
return ECL_PTR_CONS(obj);
#else
obj->t = t_list;
obj->car = a;
obj->cdr = ECL_NIL;
return (cl_object)obj;
#endif
}
cl_object
ecl_alloc_instance(cl_index slots)
{

View file

@ -265,7 +265,7 @@ extern ECL_API struct cl_core_struct cl_core;
extern ECL_API cl_object ecl_alloc_object(cl_type t);
extern ECL_API cl_object ecl_alloc_instance(cl_index slots);
extern ECL_API cl_object ecl_cons(cl_object a, cl_object d);
extern ECL_API cl_object ecl_list1(cl_object a);
#define ecl_list1(x) ecl_cons(x, ECL_NIL)
#ifdef GBC_BOEHM
extern ECL_API cl_object si_gc(cl_narg narg, ...);
extern ECL_API cl_object si_gc_dump(void);