Skip to content

Commit 8ee112c

Browse files
author
Curtis Spencer
committed
Register allocated memory with GC during initialization.
1 parent 9f9b3f5 commit 8ee112c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/containers/openhashset.d

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,9 @@ private:
277277
void initialize(size_t nodeCount)
278278
{
279279
nodes = (cast (Node*) allocator.allocate(nodeCount * Node.sizeof))[0 .. nodeCount];
280-
nodes[] = Node.init;
280+
static if (useGC)
281+
GC.addRange(nodes.ptr, nodes.length * Node.sizeof, typeid(typeof(nodes)));
282+
nodes[] = Node.init;
281283
_length = 0;
282284
}
283285

0 commit comments

Comments
 (0)