mirror of
https://github.com/corda/corda.git
synced 2024-12-28 16:58:55 +00:00
GC stress fix in make()
This commit is contained in:
parent
de9213ce30
commit
9f91f221dd
2
makefile
2
makefile
@ -1,4 +1,4 @@
|
|||||||
#MAKEFLAGS = -s
|
MAKEFLAGS = -s
|
||||||
|
|
||||||
arch = $(shell uname -m)
|
arch = $(shell uname -m)
|
||||||
ifeq ($(arch),i586)
|
ifeq ($(arch),i586)
|
||||||
|
22
src/run.cpp
22
src/run.cpp
@ -76,19 +76,7 @@ popFrame(Thread* t)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
object
|
||||||
registerWeakReference(Thread* t, object r)
|
|
||||||
{
|
|
||||||
PROTECT(t, r);
|
|
||||||
|
|
||||||
ACQUIRE(t, t->vm->referenceLock);
|
|
||||||
|
|
||||||
// jreferenceNext(t, r)
|
|
||||||
cast<object>(r, 3 * BytesPerWord) = t->vm->weakReferences;
|
|
||||||
t->vm->weakReferences = r;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline object
|
|
||||||
make(Thread* t, object class_)
|
make(Thread* t, object class_)
|
||||||
{
|
{
|
||||||
PROTECT(t, class_);
|
PROTECT(t, class_);
|
||||||
@ -99,7 +87,13 @@ make(Thread* t, object class_)
|
|||||||
sizeInBytes - sizeof(object));
|
sizeInBytes - sizeof(object));
|
||||||
|
|
||||||
if (UNLIKELY(classVmFlags(t, class_) & WeakReferenceFlag)) {
|
if (UNLIKELY(classVmFlags(t, class_) & WeakReferenceFlag)) {
|
||||||
registerWeakReference(t, instance);
|
PROTECT(t, instance);
|
||||||
|
|
||||||
|
ACQUIRE(t, t->vm->referenceLock);
|
||||||
|
|
||||||
|
// jreferenceNext(t, r)
|
||||||
|
cast<object>(instance, 3 * BytesPerWord) = t->vm->weakReferences;
|
||||||
|
t->vm->weakReferences = instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
return instance;
|
return instance;
|
||||||
|
Loading…
Reference in New Issue
Block a user