From e53b3d14bd50e17084b67ea98403eda8d3528fae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kochma=C5=84ski?= Date: Sat, 19 Nov 2022 12:40:18 +0100 Subject: [PATCH] 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)`. --- src/c/alloc_2.d | 20 -------------------- src/h/external.h | 2 +- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/src/c/alloc_2.d b/src/c/alloc_2.d index 7f72bf668..2c1964b75 100644 --- a/src/c/alloc_2.d +++ b/src/c/alloc_2.d @@ -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) { diff --git a/src/h/external.h b/src/h/external.h index 835001d64..6e481d627 100755 --- a/src/h/external.h +++ b/src/h/external.h @@ -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);