Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
fix calling destructors on qualified structs
Browse files Browse the repository at this point in the history
optimize by not calling TypeInfo.next again and again
remove type info argument from GC.setAttr/setBits
  • Loading branch information
rainers authored and Orvid committed Jan 13, 2015
1 parent 0b72987 commit 9cb7331
Show file tree
Hide file tree
Showing 2 changed files with 152 additions and 95 deletions.
12 changes: 6 additions & 6 deletions src/gc/gc.d
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ class GC
/**
*
*/
uint setAttr(void* p, uint mask, const TypeInfo inf = null) nothrow
uint setAttr(void* p, uint mask) nothrow
{
if (!p)
{
Expand All @@ -389,7 +389,7 @@ class GC
auto biti = cast(size_t)(p - pool.baseAddr) >> pool.shiftBy;

oldb = gcx.getBits(pool, biti);
gcx.setBits(pool, biti, mask, inf);
gcx.setBits(pool, biti, mask);
}
return oldb;
}
Expand Down Expand Up @@ -600,7 +600,7 @@ class GC
if (bits)
{
gcx.clrBits(pool, biti, ~BlkAttr.NONE);
gcx.setBits(pool, biti, bits, ti);
gcx.setBits(pool, biti, bits);
}
else
{
Expand Down Expand Up @@ -652,7 +652,7 @@ class GC
{
immutable biti = cast(size_t)(p - pool.baseAddr) >> pool.shiftBy;
gcx.clrBits(pool, biti, ~BlkAttr.NONE);
gcx.setBits(pool, biti, bits, ti);
gcx.setBits(pool, biti, bits);
}
alloc_size = newsz * PAGESIZE;
return p;
Expand All @@ -669,7 +669,7 @@ class GC
if (bits)
{
gcx.clrBits(pool, biti, ~BlkAttr.NONE);
gcx.setBits(pool, biti, bits, ti);
gcx.setBits(pool, biti, bits);
}
else
{
Expand Down Expand Up @@ -2889,7 +2889,7 @@ struct Gcx
/**
*
*/
void setBits(Pool* pool, size_t biti, uint mask, const TypeInfo inf = null) nothrow
void setBits(Pool* pool, size_t biti, uint mask) nothrow
in
{
assert(pool);
Expand Down
Loading

0 comments on commit 9cb7331

Please sign in to comment.