 |
Changeset 5431
- Timestamp:
- 04/15/10 01:51:46
(2 years ago)
- Author:
- kris
- Message:
fixes #1903 :: Objects are garbage collected despite being referenced from a HashSet?
big thank-you to dhasanan
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r5418 |
r5431 |
|
| 130 | 130 | { |
|---|
| 131 | 131 | auto p = (cast(T**) calloc(count, (T*).sizeof)) [0 .. count]; |
|---|
| 132 | | GC.addRoot (cast(void*) p); |
|---|
| | 132 | GC.addRange (cast(void*) p, count * (T*).sizeof); |
|---|
| 133 | 133 | return p; |
|---|
| 134 | 134 | } |
|---|
| … | … | |
| 144 | 144 | if (t.ptr) |
|---|
| 145 | 145 | { |
|---|
| 146 | | GC.removeRoot (t.ptr); |
|---|
| | 146 | GC.removeRange (t.ptr); |
|---|
| 147 | 147 | free (t.ptr); |
|---|
| 148 | 148 | } |
|---|
| … | … | |
| 181 | 181 | foreach (ref list; lists) |
|---|
| 182 | 182 | { |
|---|
| 183 | | GC.removeRoot (list.ptr); |
|---|
| | 183 | GC.removeRange (list.ptr); |
|---|
| 184 | 184 | free (list.ptr); |
|---|
| 185 | 185 | list = null; |
|---|
| … | … | |
| 217 | 217 | auto p = (cast(T*) calloc (chunks, T.sizeof)) [0 .. chunks]; |
|---|
| 218 | 218 | lists[$-1] = p; |
|---|
| 219 | | GC.addRoot (p.ptr); |
|---|
| | 219 | GC.addRange (p.ptr, T.sizeof * chunks); |
|---|
| 220 | 220 | auto head = cache; |
|---|
| 221 | 221 | foreach (ref node; p) |
|---|
Download in other formats:
|
 |
 |
|
 |
Copyright © 2006-2012 Tango. All Rights Reserved. | Page Width:
Static or
Dynamic