mirror of
https://github.com/corda/corda.git
synced 2025-02-10 21:01:27 +00:00
move allocation zone from makeCodeImage to writeBootImage so it stays in scope until after updateConstants is called
This commit is contained in:
parent
a8a030140c
commit
6dc181fad5
@ -38,12 +38,11 @@ codeMapSize(unsigned codeSize)
|
|||||||
}
|
}
|
||||||
|
|
||||||
object
|
object
|
||||||
makeCodeImage(Thread* t, BootImage* image, uint8_t* code, unsigned capacity)
|
makeCodeImage(Thread* t, Zone* zone, BootImage* image, uint8_t* code,
|
||||||
|
unsigned capacity)
|
||||||
{
|
{
|
||||||
unsigned size = 0;
|
unsigned size = 0;
|
||||||
t->m->processor->compileThunks(t, image, code, &size, capacity);
|
t->m->processor->compileThunks(t, image, code, &size, capacity);
|
||||||
|
|
||||||
Zone zone(t->m->system, t->m->heap, 64 * 1024);
|
|
||||||
|
|
||||||
object constants = 0;
|
object constants = 0;
|
||||||
PROTECT(t, constants);
|
PROTECT(t, constants);
|
||||||
@ -66,7 +65,7 @@ makeCodeImage(Thread* t, BootImage* image, uint8_t* code, unsigned capacity)
|
|||||||
object method = arrayBody(t, classMethodTable(t, c), i);
|
object method = arrayBody(t, classMethodTable(t, c), i);
|
||||||
if (methodCode(t, method)) {
|
if (methodCode(t, method)) {
|
||||||
t->m->processor->compileMethod
|
t->m->processor->compileMethod
|
||||||
(t, &zone, code, &size, capacity, &constants, &calls, method);
|
(t, zone, code, &size, capacity, &constants, &calls, method);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -206,6 +205,7 @@ offset(object a, uintptr_t* b)
|
|||||||
void
|
void
|
||||||
writeBootImage(Thread* t, FILE*)
|
writeBootImage(Thread* t, FILE*)
|
||||||
{
|
{
|
||||||
|
Zone zone(t->m->system, t->m->heap, 64 * 1024);
|
||||||
BootImage image;
|
BootImage image;
|
||||||
|
|
||||||
const unsigned CodeCapacity = 32 * 1024 * 1024;
|
const unsigned CodeCapacity = 32 * 1024 * 1024;
|
||||||
@ -214,7 +214,7 @@ writeBootImage(Thread* t, FILE*)
|
|||||||
(t->m->heap->allocate(codeMapSize(CodeCapacity)));
|
(t->m->heap->allocate(codeMapSize(CodeCapacity)));
|
||||||
memset(codeMap, 0, codeMapSize(CodeCapacity));
|
memset(codeMap, 0, codeMapSize(CodeCapacity));
|
||||||
|
|
||||||
object constants = makeCodeImage(t, &image, code, CodeCapacity);
|
object constants = makeCodeImage(t, &zone, &image, code, CodeCapacity);
|
||||||
|
|
||||||
const unsigned HeapCapacity = 32 * 1024 * 1024;
|
const unsigned HeapCapacity = 32 * 1024 * 1024;
|
||||||
uintptr_t* heap = static_cast<uintptr_t*>
|
uintptr_t* heap = static_cast<uintptr_t*>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user