summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-08-06 20:46:37 -0700
committerKaz Kylheku <kaz@kylheku.com>2019-08-06 20:46:37 -0700
commita51ddd81bc4c6edc898abbf658c3402ad0c9fe86 (patch)
tree390e94bdc24a9dae4d5880ed25c6a4c40a5ac764
parent43c155414cf8425c7f38196c0f31b592de9ae15e (diff)
downloadtxr-a51ddd81bc4c6edc898abbf658c3402ad0c9fe86.tar.gz
txr-a51ddd81bc4c6edc898abbf658c3402ad0c9fe86.tar.bz2
txr-a51ddd81bc4c6edc898abbf658c3402ad0c9fe86.zip
lib: don't GC-protect two non-heap objects.
* lib.c (obj_init): The null string literal and "nil" do not require gc protection; they cannot be reclaimed by the garbage collector, which ignores them. Don't waste two slots in the prot_stack on them. This is a remnant from ancient TXR; these variables were protected already in Version 11 from September 2009. At that time, there were no built-in string literal objects; these two objects were heap-allocated.
-rw-r--r--lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib.c b/lib.c
index 08b84c74..f08c7949 100644
--- a/lib.c
+++ b/lib.c
@@ -10765,7 +10765,7 @@ static void obj_init(void)
*/
protect(&packages, &system_package, &keyword_package,
- &user_package, &public_package, &null_string, &nil_string,
+ &user_package, &public_package,
&null_list, &equal_f, &eq_f, &eql_f,
&car_f, &cdr_f, &null_f, &list_f,
&identity_f, &less_f, &greater_f, &prog_string, &env_list,