Tons of bugfixes (lots with closures). Added safe_recursive_delete to mem which helps easily and safely delete recursive data structures, and used it in regex. It still has a leak, but it's a lot better than before.

This commit is contained in:
Nathan Braswell
2015-06-28 14:27:48 -04:00
parent c50c977a9e
commit 48683889da
9 changed files with 80 additions and 13 deletions

View File

@@ -1,4 +1,6 @@
import io:*
import set
import mem
fun runFunc(func: fun():void) {
func()
@@ -18,10 +20,23 @@ obj ToClose {
}
}
obj One (Object) {
fun construct(): One* {
return this
}
fun destruct() {
var a:One
mem::safe_recursive_delete(&a, fun(it: One*): set::set<One*> { return set::set(it); } )
}
}
fun main():int {
var it: ToClose
it.testMethod()
it.testVariable()
//var a = 7
//mem::safe_recursive_delete(&a, fun(it: int*): set::set<int*> { return set::set(it); } )
return 0
}