okami.mom/albedo

git clone https://git.nkp.pet/okami.mom/albedo

nekomimi.petruntime: share the installed extensions through a persistent term so the Runtime handle and every selection over it copy nothinge4803b3

main
468 B13 linesraw
1%% What a spawn or send copies: the heap words of a process whose closure
2%% holds Term. A term read from a persistent term is a literal and costs none.
3-module(albedo_copy_test_support).
4
5-export([captured_words/1]).
6
7captured_words(Term) ->
8    Self = self(),
9    Pid = spawn(fun() -> Self ! {ready, self()}, receive go -> Term end end),
10    receive {ready, Pid} -> ok end,
11    {total_heap_size, Words} = process_info(Pid, total_heap_size),
12    Pid ! go,
13    Words.