From abac04c58eb2b460eadf8c5d9f2e6ac7965123c5 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Wed, 15 Apr 2015 13:30:28 -0400 Subject: [PATCH] Replace set-cell! with set-car! Set-cell was just a wrapper on set-car anyway, but it was failing to record a mutation, which would cause problems later on for the GC. By using set-car directly we avoid GC issues and simplify the runtime code a bit. --- cgen.scm | 2 +- runtime.h | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/cgen.scm b/cgen.scm index 046de06c..d473463e 100644 --- a/cgen.scm +++ b/cgen.scm @@ -487,7 +487,7 @@ ((eq? p 'cons) "make_cons") ((eq? p 'cell) "make_cell") ((eq? p 'cell-get) "cell_get") - ((eq? p 'set-cell!) "cell_set") + ((eq? p 'set-cell!) "Cyc_set_car") ((eq? p 'set-global!) "global_set") (else (error "unhandled primitive: " p)))) diff --git a/runtime.h b/runtime.h index 0c12c974..057ad23c 100644 --- a/runtime.h +++ b/runtime.h @@ -20,10 +20,6 @@ static const object Cyc_EOF = &__EOF; static object cell_get(object cell){ return car(cell); } -static object cell_set(object cell, object value){ - ((list) cell)->cons_car = value; - return cell; -} #define global_set(glo,value) (glo=value)