gc and cons pairs
This commit is contained in:
parent
d64b0f0a6f
commit
fe9a8a7039
8 changed files with 217 additions and 10 deletions
11
main.c
11
main.c
|
|
@ -1,12 +1,15 @@
|
|||
#include <stdio.h>
|
||||
#include "wscm.h"
|
||||
|
||||
int main(void) {
|
||||
gcinit();
|
||||
|
||||
const S *hello = intern("hello", -1);
|
||||
printf("hello = %p\n", (void *)hello);
|
||||
const S *goodbye = intern("goodbye", -1);
|
||||
O p = cons(BOX(hello), BOX(goodbye));
|
||||
addroot(&p);
|
||||
|
||||
const S *hello2 = intern("hello", -1);
|
||||
printf("hello2 = %p (should be equal to hello)\n", (void *)hello2);
|
||||
collect();
|
||||
|
||||
gcfinalize();
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue