[{"data":1,"prerenderedAt":347},["ShallowReactive",2],{"doc:\u002Fguides\u002Fownership":3,"nav:guides":297},{"doc":4,"source":296},{"id":5,"title":6,"body":7,"description":17,"extension":289,"meta":290,"navigation":291,"path":292,"seo":293,"stem":294,"__hash__":295},"guides\u002Fguides\u002Fownership.md","Ownership",{"type":8,"value":9,"toc":282},"minimark",[10,14,18,189,194,215,219,232,242,254,258,275],[11,12,6],"h1",{"id":13},"ownership",[15,16,17],"p",{},"zig-pkl allocates only through allocators you pass in, and every allocation has one owner that frees it.",[19,20,21,37],"table",{},[22,23,24],"thead",{},[25,26,27,31,34],"tr",{},[28,29,30],"th",{},"Value",[28,32,33],{},"Owner",[28,35,36],{},"Release",[38,39,40,61,83,100,120,137,154,174],"tbody",{},[25,41,42,53,56],{},[43,44,45,49,50],"td",{},[46,47,48],"code",{},"*Manager"," from ",[46,51,52],{},"Manager.init",[43,54,55],{},"caller",[43,57,58],{},[46,59,60],{},"manager.deinit()",[25,62,63,71,74],{},[43,64,65,49,68],{},[46,66,67],{},"*Evaluator",[46,69,70],{},"createEvaluator",[43,72,73],{},"the manager",[43,75,76,79,80],{},[46,77,78],{},"evaluator.close()","; memory is freed by ",[46,81,82],{},"Manager.deinit",[25,84,85,93,95],{},[43,86,87,49,90],{},[46,88,89],{},"value.Tree",[46,91,92],{},"evaluate*",[43,94,55],{},[43,96,97],{},[46,98,99],{},"tree.deinit()",[25,101,102,112,114],{},[43,103,104,105,108,109],{},"result of ",[46,106,107],{},"evaluateInto"," or ",[46,110,111],{},"convert.into",[43,113,55],{},[43,115,116,119],{},[46,117,118],{},"convert.freeInto(T, allocator, value)"," with the same allocator",[25,121,122,132,134],{},[43,123,124,127,128,131],{},[46,125,126],{},"failure"," and ",[46,129,130],{},"rejected"," messages",[43,133,55],{},[43,135,136],{},"free with the manager's allocator",[25,138,139,147,149],{},[43,140,141,49,144],{},[46,142,143],{},"project.Owned",[46,145,146],{},"project.load*",[43,148,55],{},[43,150,151],{},[46,152,153],{},"project.deinit()",[25,155,156,169,171],{},[43,157,158,159,162,163,162,166],{},"strings from ",[46,160,161],{},"uri.fromFile",", ",[46,164,165],{},"uri.fromPath",[46,167,168],{},"Owned.moduleUri",[43,170,55],{},[43,172,173],{},"free with the allocator passed in",[25,175,176,182,184],{},[43,177,178,179],{},"generated types from ",[46,180,181],{},"zig-pkl-gen",[43,183,55],{},[43,185,186],{},[46,187,188],{},"value.deinit(allocator)",[190,191,193],"h2",{"id":192},"trees","Trees",[15,195,196,197,200,201,203,204,207,208,211,212,214],{},"A ",[46,198,199],{},"Tree"," keeps every node and string in one arena. ",[46,202,99],{}," frees all of it at once, and every ",[46,205,206],{},"*Value"," and slice taken from the tree becomes invalid. Use ",[46,209,210],{},"value.clone"," to keep part of a tree, or convert it into owned Zig values with ",[46,213,111],{},".",[190,216,218],{"id":217},"borrowed-options","Borrowed options",[15,220,221,224,225,227,228,231],{},[46,222,223],{},"Options"," borrows everything it points to: allow lists, environment pairs, readers, loggers, the project. They must outlive ",[46,226,70],{},". Readers and loggers, and the contexts behind them, must also outlive the evaluator, because the server calls back into them until ",[46,229,230],{},"close"," returns.",[15,233,234,237,238,241],{},[46,235,236],{},"Builder"," owns only the allow list patterns it builds. Keep it alive until the evaluators created from ",[46,239,240],{},"builder.options"," are created; keep the readers alive until those evaluators are closed.",[15,243,244,246,247,127,250,253],{},[46,245,143],{}," owns every string in its ",[46,248,249],{},"options",[46,251,252],{},"project",", so it must outlive the evaluators created from them.",[190,255,257],{"id":256},"allocators","Allocators",[15,259,260,261,263,264,267,268,271,272,214],{},"The manager allocates requests, responses, and messages with the allocator given to ",[46,262,52],{},", from several threads. Pass a thread-safe allocator such as ",[46,265,266],{},"std.heap.smp_allocator"," or the ",[46,269,270],{},"init.gpa"," of ",[46,273,274],{},"std.process.Init",[15,276,277,127,279,281],{},[46,278,107],{},[46,280,111],{}," use the allocator you pass to them and can use any allocator, including an arena that you free in one step.",{"title":283,"searchDepth":284,"depth":284,"links":285},"",2,[286,287,288],{"id":192,"depth":284,"text":193},{"id":217,"depth":284,"text":218},{"id":256,"depth":284,"text":257},"md",{},true,"\u002Fguides\u002Fownership",{"title":6,"description":17},"guides\u002Fownership","7lO__1vuJnoyiALUF6g8HuFMWs1YV0LhlsgMPcySKVQ","docs\u002Fguides\u002Fownership.md",[298,302,306,310,314,318,322,326,330,331,335,339,343],{"title":299,"path":300,"stem":301},"Version compatibility","\u002Fguides\u002Fcompatibility","guides\u002Fcompatibility",{"title":303,"path":304,"stem":305},"Concurrency","\u002Fguides\u002Fconcurrency","guides\u002Fconcurrency",{"title":307,"path":308,"stem":309},"Errors","\u002Fguides\u002Ferrors","guides\u002Ferrors",{"title":311,"path":312,"stem":313},"Evaluation","\u002Fguides\u002Fevaluation","guides\u002Fevaluation",{"title":315,"path":316,"stem":317},"External readers","\u002Fguides\u002Fexternal-readers","guides\u002Fexternal-readers",{"title":319,"path":320,"stem":321},"Installation","\u002Fguides\u002Finstallation","guides\u002Finstallation",{"title":323,"path":324,"stem":325},"Logging","\u002Fguides\u002Flogging","guides\u002Flogging",{"title":327,"path":328,"stem":329},"Migrating from pkl-zig","\u002Fguides\u002Fmigration","guides\u002Fmigration",{"title":6,"path":292,"stem":294},{"title":332,"path":333,"stem":334},"Projects","\u002Fguides\u002Fprojects","guides\u002Fprojects",{"title":336,"path":337,"stem":338},"Quick start","\u002Fguides\u002Fquickstart","guides\u002Fquickstart",{"title":340,"path":341,"stem":342},"Readers","\u002Fguides\u002Freaders","guides\u002Freaders",{"title":344,"path":345,"stem":346},"Security","\u002Fguides\u002Fsecurity","guides\u002Fsecurity",1792908673525]