-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add unit test 229 to verify spork dangling refs
- Loading branch information
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// verify no dangling reference with sporked | ||
// functions that return Objects | ||
|
||
Object foo; | ||
|
||
// function that returns an Object | ||
fun Object get() | ||
{ | ||
return foo; | ||
} | ||
|
||
// spork | ||
spork ~ get(); | ||
|
||
// give sporked function a chance to run | ||
10::ms => now; | ||
|
||
// check reference count | ||
if( Machine.refcount(foo) == 1 ) <<< "success" >>>; |