swissChili | 8056031 | 2022-07-31 21:05:47 -0700 | [diff] [blame] | 1 | (defun test-gc-eval () |
| 2 | (eval '(progn |
| 3 | (list "hello" "world") |
| 4 | (gc)))) |
| 5 | |
swissChili | a890aed | 2022-07-30 17:13:07 -0700 | [diff] [blame] | 6 | (defun main () |
| 7 | ;; Allocate some garbage |
| 8 | (let1 (used "this should NOT be freed") |
| 9 | (list 1 2 3 4) |
| 10 | (list "this" "is" "a" "list") |
| 11 | (gc) |
| 12 | (print (list "Current allocations" "GC runs")) |
swissChili | 8056031 | 2022-07-31 21:05:47 -0700 | [diff] [blame] | 13 | (print (gc-stats))) |
| 14 | (print "testing gc in eval") |
| 15 | (test-gc-eval)) |
swissChili | a890aed | 2022-07-30 17:13:07 -0700 | [diff] [blame] | 16 | |
| 17 | ;; Note: This should print that it is freeing both lists, but not the |
| 18 | ;; string |