mirror of
https://github.com/corda/corda.git
synced 2025-01-19 11:16:54 +00:00
use THREAD_RUNTIME_ARRAY instead of RUNTIME_ARRAY where appropriate
This ensures that if the stack is unwound for an exception we'll still release the memory.
This commit is contained in:
parent
f2d2c9af29
commit
d97fe5304f
@ -342,7 +342,7 @@ makeCodeImage(Thread* t, Zone* zone, BootImage* image, uint8_t* code,
|
||||
|
||||
unsigned count = s.read2() - 1;
|
||||
if (count) {
|
||||
RUNTIME_ARRAY(Type, types, count + 2);
|
||||
THREAD_RUNTIME_ARRAY(t, Type, types, count + 2);
|
||||
types[0] = Type_object;
|
||||
types[1] = Type_intptr_t;
|
||||
|
||||
@ -420,7 +420,7 @@ makeCodeImage(Thread* t, Zone* zone, BootImage* image, uint8_t* code,
|
||||
object fields = allFields(t, typeMaps, c, &count, &array);
|
||||
PROTECT(t, fields);
|
||||
|
||||
RUNTIME_ARRAY(Field, memberFields, count + 1);
|
||||
THREAD_RUNTIME_ARRAY(t, Field, memberFields, count + 1);
|
||||
|
||||
unsigned memberIndex;
|
||||
unsigned buildMemberOffset;
|
||||
@ -454,7 +454,7 @@ makeCodeImage(Thread* t, Zone* zone, BootImage* image, uint8_t* code,
|
||||
|
||||
const unsigned StaticHeader = 3;
|
||||
|
||||
RUNTIME_ARRAY(Field, staticFields, count + StaticHeader);
|
||||
THREAD_RUNTIME_ARRAY(t, Field, staticFields, count + StaticHeader);
|
||||
|
||||
init(new (&staticFields[0]) Field, Type_object, 0, BytesPerWord, 0,
|
||||
TargetBytesPerWord);
|
||||
@ -1334,7 +1334,7 @@ writeBootImage2(Thread* t, OutputStream* bootimageOutput, OutputStream* codeOutp
|
||||
}
|
||||
++ count;
|
||||
|
||||
RUNTIME_ARRAY(Field, fields, count);
|
||||
THREAD_RUNTIME_ARRAY(t, Field, fields, count);
|
||||
|
||||
init(new (&fields[0]) Field, Type_object, 0, BytesPerWord, 0,
|
||||
TargetBytesPerWord);
|
||||
|
@ -647,7 +647,7 @@ invokeNative(Thread* t, object method)
|
||||
{ THREAD_RESOURCE0(t, popFrame(static_cast<Thread*>(t)));
|
||||
|
||||
unsigned footprint = methodParameterFootprint(t, method);
|
||||
RUNTIME_ARRAY(uintptr_t, args, footprint);
|
||||
THREAD_RUNTIME_ARRAY(t, uintptr_t, args, footprint);
|
||||
unsigned sp = frameBase(t, t->frame);
|
||||
unsigned argOffset = 0;
|
||||
if ((methodFlags(t, method) & ACC_STATIC) == 0) {
|
||||
@ -2321,7 +2321,7 @@ interpret3(Thread* t, const int base)
|
||||
object class_ = resolveClassInPool(t, frameMethod(t, frame), index - 1);
|
||||
PROTECT(t, class_);
|
||||
|
||||
RUNTIME_ARRAY(int32_t, counts, dimensions);
|
||||
THREAD_RUNTIME_ARRAY(t, int32_t, counts, dimensions);
|
||||
for (int i = dimensions - 1; i >= 0; --i) {
|
||||
counts[i] = popInt(t);
|
||||
if (UNLIKELY(counts[i] < 0)) {
|
||||
|
Loading…
Reference in New Issue
Block a user