mirror of
https://github.com/carp-lang/Carp.git
synced 2024-11-05 18:21:40 +03:00
12 lines
424 B
Plaintext
12 lines
424 B
Plaintext
;; This test is special because it requires it's own run.
|
|
;; It initializes a global with a something that needs to allocate memory and call functions,
|
|
;; then checks that the memory balance is correct after the init step.
|
|
|
|
(load "Debug.carp")
|
|
|
|
(def g (copy (Array.nth &[@"A" @"B" @"C"] 1)))
|
|
|
|
;; The one allocation left after 'carp_init_globals' should be 'g' itself:
|
|
(defn main []
|
|
(assert (= 1l (Debug.memory-balance))))
|