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

Commit

Permalink
THREADINVARIANT asserted single threading
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinNowak committed Jun 22, 2012
1 parent b2ceb65 commit 58727c9
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions src/gc/gcx.d
Expand Up @@ -19,7 +19,6 @@ module gc.gcx;

//debug = PRINTF; // turn on printf's
//debug = COLLECT_PRINTF; // turn on printf's
//debug = THREADINVARIANT; // check thread integrity
//debug = LOGGING; // log allocations / frees
//debug = MEMSTOMP; // stomp on memory
//debug = SENTINEL; // add underrun/overrrun protection
Expand Down Expand Up @@ -286,15 +285,6 @@ class GC
}


invariant()
{
if (gcx)
{
gcx.thread_Invariant();
}
}


/**
*
*/
Expand Down Expand Up @@ -1511,21 +1501,6 @@ immutable size_t notbinsize[B_MAX] = [ ~(16-1),~(32-1),~(64-1),~(128-1),~(256-1)

struct Gcx
{
debug (THREADINVARIANT)
{
pthread_t self;
void thread_Invariant() const
{
if (self != pthread_self())
printf("thread_Invariant(): gcx = %p, self = %x, pthread_self() = %x\n", &this, self, pthread_self());
assert(self == pthread_self());
}
}
else
{
void thread_Invariant() const { }
}

void *cached_size_key;
size_t cached_size_val;

Expand Down Expand Up @@ -1561,8 +1536,6 @@ struct Gcx

(cast(byte*)&this)[0 .. Gcx.sizeof] = 0;
log_init();
debug (THREADINVARIANT)
self = pthread_self();
//printf("gcx = %p, self = %x\n", &this, self);
inited = 1;
}
Expand Down Expand Up @@ -1613,9 +1586,6 @@ struct Gcx
{
//printf("Gcx.invariant(): this = %p\n", &this);

// Assure we're called on the right thread
debug (THREADINVARIANT) assert(self == pthread_self());

for (size_t i = 0; i < npools; i++)
{ auto pool = pooltable[i];

Expand Down

0 comments on commit 58727c9

Please sign in to comment.