summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
60c2ff1)
It doesn't make any sense to make it static, since all the GC struct can't
be instantiated more than once anyway.
- static ClassInfo gcLock; // global lock
+ ClassInfo lock; // global lock
void *p_cache;
size_t size_cache;
void *p_cache;
size_t size_cache;
int dummy;
stackBottom = cast(char*)&dummy;
opts.parse(cstdlib.getenv("D_GC_OPTS"));
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);
inited = 1;
setStackBottom(rt_stackBottom());
stats = Stats(this);
assert(this.disabled > 0);
this.disabled--;
}
assert(this.disabled > 0);
this.disabled--;
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
assert(this.disabled > 0);
this.disabled--;
{
assert(this.disabled > 0);
this.disabled--;
- else synchronized (gcLock)
+ else synchronized (lock)
- else synchronized (gcLock)
+ else synchronized (lock)
- else synchronized (gcLock)
+ else synchronized (lock)
- else synchronized (gcLock)
+ else synchronized (lock)
{
return mallocNoSync(size, attrs, ptrmap.bits.ptr);
}
{
return mallocNoSync(size, attrs, ptrmap.bits.ptr);
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
return mallocNoSync(size, attrs, ptrmap.bits.ptr);
}
{
return mallocNoSync(size, attrs, ptrmap.bits.ptr);
}
* and lock for a collection, since a finalizer
* may start a new thread.
*/
* and lock for a collection, since a finalizer
* may start a new thread.
*/
{
this.fullcollectshell();
}
{
this.fullcollectshell();
}
{
return callocNoSync(size, attrs, ptrmap.bits.ptr);
}
{
return callocNoSync(size, attrs, ptrmap.bits.ptr);
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
return callocNoSync(size, attrs, ptrmap.bits.ptr);
}
{
return callocNoSync(size, attrs, ptrmap.bits.ptr);
}
{
return reallocNoSync(p, 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);
}
{
return reallocNoSync(p, size, attrs, ptrmap.bits.ptr);
}
if (newsz < psz)
{
// Shrink in place
if (newsz < psz)
{
// Shrink in place
{
if (opts.options.mem_stomp)
memset(p + size - pm_bitmask_size, 0xF2,
{
if (opts.options.mem_stomp)
memset(p + size - pm_bitmask_size, 0xF2,
else if (pagenum + newsz <= pool.npages)
{
// Attempt to expand in place
else if (pagenum + newsz <= pool.npages)
{
// Attempt to expand in place
{
for (size_t i = pagenum + psz; 1;)
{
{
for (size_t i = pagenum + psz; 1;)
{
{
return extendNoSync(p, minsize, maxsize);
}
{
return extendNoSync(p, minsize, maxsize);
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
return extendNoSync(p, minsize, maxsize);
}
{
return extendNoSync(p, minsize, maxsize);
}
{
return reserveNoSync(size);
}
{
return reserveNoSync(size);
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
return reserveNoSync(size);
}
{
return reserveNoSync(size);
}
{
return freeNoSync(p);
}
{
return freeNoSync(p);
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
return freeNoSync(p);
}
{
return freeNoSync(p);
}
{
return addrOfNoSync(p);
}
{
return addrOfNoSync(p);
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
return addrOfNoSync(p);
}
{
return addrOfNoSync(p);
}
{
return sizeOfNoSync(p);
}
{
return sizeOfNoSync(p);
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
return sizeOfNoSync(p);
}
{
return sizeOfNoSync(p);
}
{
return queryNoSync(p);
}
{
return queryNoSync(p);
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
return queryNoSync(p);
}
{
return queryNoSync(p);
}
- else synchronized (gcLock)
+ else synchronized (lock)
if (roots.append(p) is null)
onOutOfMemoryError();
}
if (roots.append(p) is null)
onOutOfMemoryError();
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
if (roots.append(p) is null)
onOutOfMemoryError();
{
if (roots.append(p) is null)
onOutOfMemoryError();
- else synchronized (gcLock)
+ else synchronized (lock)
if (ranges.append(Range(p, p+sz)) is null)
onOutOfMemoryError();
}
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();
{
if (ranges.append(Range(p, p+sz)) is null)
onOutOfMemoryError();
{
r = ranges.remove(Range(p, null));
}
{
r = ranges.remove(Range(p, null));
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
r = ranges.remove(Range(p, null));
}
{
r = ranges.remove(Range(p, null));
}
{
this.fullcollectshell();
}
{
this.fullcollectshell();
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
this.fullcollectshell();
}
{
this.fullcollectshell();
}
this.fullcollectshell();
this.noStack--;
}
this.fullcollectshell();
this.noStack--;
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
this.noStack++;
this.fullcollectshell();
{
this.noStack++;
this.fullcollectshell();
{
this.minimizeNoSync();
}
{
this.minimizeNoSync();
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
this.minimizeNoSync();
}
{
this.minimizeNoSync();
}
{
getStatsNoSync(stats);
}
{
getStatsNoSync(stats);
}
- else synchronized (gcLock)
+ else synchronized (lock)
{
getStatsNoSync(stats);
}
{
getStatsNoSync(stats);
}
private T locked(T)(in T delegate() code)
{
if (thread_needLock)
private T locked(T)(in T delegate() code)
{
if (thread_needLock)
- synchronized(gcLock) return code();
+ synchronized(lock) return code();