ludic/docs/language/json/json-free.md
Orkuncakilkaya 22d1e2d66a Os.heap_bytes: the heap without the renderer; string_temps reads it
Vk.heap_bytes pulled the Vk module - and on lang/uifree the GL window path - into a plain program,
which then failed to link (_cgl_offscreen, lgl_GetError). Os.heap_bytes is malloc_zone_statistics
through a weak reference (0 where there is none, and on Windows). Reseeded. Docs for it and for
Json.free / Json.free_all.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 12:31:42 +03:00

885 B

id name category kind tokens sig tip order ns member
json-free Json.free json namespace-method Json.free Json.free(value) -> void Give back a parsed tree's nodes; its strings stay. 3 Json free

Gives back every node and list of a tree Json.parse made, once what it describes has been built. Ludic has no garbage collector, so a tree read and dropped is otherwise kept for as long as the program runs. The tree's strings stay, because a reader may keep a name it took out of it; when nothing was kept, Json.free_all gives those back too. Only for a parsed tree: one put together by hand may share a node or hold a literal.

program Free {
  entry {
    let doc = Json.parse("{\"hp\": 3}")
    let hp = value_as_int(value_get(doc, "hp"))
    Json.free(doc)
    print(hp)
  }
}