ref: 06f83c93631d8af9eb25199a8229183c48b89ce8
parent: 4d6ba69e91ccaa8c3f089aa2ecfd37042350d101
author: Ori Bernstein <ori@eigenstate.org>
date: Wed Oct 24 20:05:11 EDT 2018
Heapify closures on OSX/FreeBSD. Fixes tests. (Thanks, iri)
--- a/lib/thread/spawn+freebsd.myr
+++ b/lib/thread/spawn+freebsd.myr
@@ -55,6 +55,7 @@
hdr = (tos : tlshdr#)
hdr.base = stk
hdr.stksz = sz
+ fn = std.fndup(fn)
var fn1 = {
/*
@@ -65,6 +66,7 @@
hdr.len = len
setfsbase(hdr)
fn()
+ std.fnfree(fn)
}
envsz = std.fnenvsz(fn1)
--- a/lib/thread/spawn+osx.myr
+++ b/lib/thread/spawn+osx.myr
@@ -68,10 +68,12 @@
hdr.len = len
hdr.base = stk
hdr.stksz = sz
+ fn = std.fndup(fn)
var fn1 = {
setgsbase(hdr)
fn()
+ std.fnfree(fn)
}
envsz = std.fnenvsz(fn1)