struct GC
{
- static ClassInfo gcLock; // global lock
+ ClassInfo lock; // global lock
void *p_cache;
size_t size_cache;
int dummy;
stackBottom = cast(char*)&dummy;
opts.parse(cstdlib.getenv("D_GC_OPTS"));
- gcLock = GCLock.classinfo;
+ lock = GCLock.classinfo;
inited = 1;
setStackBottom(rt_stackBottom());
stats = Stats(this);
assert(this.disabled > 0);
this.disabled--;
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
assert(this.disabled > 0);
this.disabled--;
{
this.disabled++;
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
this.disabled++;
}
{
return go();
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
return go();
}
{
return go();
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
return go();
}
{
return go();
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
return go();
}
{
return mallocNoSync(size, attrs, ptrmap.bits.ptr);
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
return mallocNoSync(size, attrs, ptrmap.bits.ptr);
}
* and lock for a collection, since a finalizer
* may start a new thread.
*/
- synchronized (gcLock)
+ synchronized (lock)
{
this.fullcollectshell();
}
{
return callocNoSync(size, attrs, ptrmap.bits.ptr);
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
return callocNoSync(size, attrs, ptrmap.bits.ptr);
}
{
return reallocNoSync(p, size, attrs, ptrmap.bits.ptr);
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
return reallocNoSync(p, size, attrs, ptrmap.bits.ptr);
}
if (newsz < psz)
{
// Shrink in place
- synchronized (gcLock)
+ synchronized (lock)
{
if (opts.options.mem_stomp)
memset(p + size - pm_bitmask_size, 0xF2,
else if (pagenum + newsz <= pool.npages)
{
// Attempt to expand in place
- synchronized (gcLock)
+ synchronized (lock)
{
for (size_t i = pagenum + psz; 1;)
{
{
return extendNoSync(p, minsize, maxsize);
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
return extendNoSync(p, minsize, maxsize);
}
{
return reserveNoSync(size);
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
return reserveNoSync(size);
}
{
return freeNoSync(p);
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
return freeNoSync(p);
}
{
return addrOfNoSync(p);
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
return addrOfNoSync(p);
}
{
return sizeOfNoSync(p);
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
return sizeOfNoSync(p);
}
{
return queryNoSync(p);
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
return queryNoSync(p);
}
{
checkNoSync(p);
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
checkNoSync(p);
}
if (roots.append(p) is null)
onOutOfMemoryError();
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
if (roots.append(p) is null)
onOutOfMemoryError();
{
r = roots.remove(p);
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
r = roots.remove(p);
}
if (ranges.append(Range(p, p+sz)) is null)
onOutOfMemoryError();
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
if (ranges.append(Range(p, p+sz)) is null)
onOutOfMemoryError();
{
r = ranges.remove(Range(p, null));
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
r = ranges.remove(Range(p, null));
}
{
this.fullcollectshell();
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
this.fullcollectshell();
}
this.fullcollectshell();
this.noStack--;
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
this.noStack++;
this.fullcollectshell();
{
this.minimizeNoSync();
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
this.minimizeNoSync();
}
{
getStatsNoSync(stats);
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
getStatsNoSync(stats);
}
private T locked(T)(in T delegate() code)
{
if (thread_needLock)
- synchronized(gcLock) return code();
+ synchronized(lock) return code();
else
return code();
}