diff options
Diffstat (limited to 'libphobos/testsuite/libphobos.gc/recoverfree.d')
-rw-r--r-- | libphobos/testsuite/libphobos.gc/recoverfree.d | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libphobos/testsuite/libphobos.gc/recoverfree.d b/libphobos/testsuite/libphobos.gc/recoverfree.d new file mode 100644 index 00000000000..59c3b4ab597 --- /dev/null +++ b/libphobos/testsuite/libphobos.gc/recoverfree.d @@ -0,0 +1,13 @@ +// https://issues.dlang.org/show_bug.cgi?id=20438 +import core.stdc.stdio; +import core.memory; + +void main() +{ + auto used0 = GC.stats.usedSize; + void* z = GC.malloc(100); + GC.free(z); + GC.collect(); + auto used1 = GC.stats.usedSize; + used1 <= used0 || assert(false); +} |