mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-14 00:07:36 +02:00
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.
This commit is contained in:
parent
03df6405e6
commit
abac04c58e
2 changed files with 1 additions and 5 deletions
2
cgen.scm
2
cgen.scm
|
@ -487,7 +487,7 @@
|
||||||
((eq? p 'cons) "make_cons")
|
((eq? p 'cons) "make_cons")
|
||||||
((eq? p 'cell) "make_cell")
|
((eq? p 'cell) "make_cell")
|
||||||
((eq? p 'cell-get) "cell_get")
|
((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")
|
((eq? p 'set-global!) "global_set")
|
||||||
(else
|
(else
|
||||||
(error "unhandled primitive: " p))))
|
(error "unhandled primitive: " p))))
|
||||||
|
|
|
@ -20,10 +20,6 @@ static const object Cyc_EOF = &__EOF;
|
||||||
static object cell_get(object cell){
|
static object cell_get(object cell){
|
||||||
return car(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)
|
#define global_set(glo,value) (glo=value)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue