Fix crash on Return to Menu in Symbian.

We don't want to free the executable code (actually a Chunk+Heap) using same method we use to free memory pages (delete).
This would be the same situation on jailbroken iOS and WP.
Now the JIT code is always allocated and never freed on Symbian.
This commit is contained in:
Sacha 2013-02-21 15:59:02 +10:00
parent 2dda6874bd
commit 8e88cc37d2
2 changed files with 6 additions and 1 deletions

View File

@ -552,7 +552,9 @@ public:
// Call this when shutting down. Don't rely on the destructor, even though it'll do the job.
void FreeCodeSpace()
{
#ifndef __SYMBIAN32__
FreeMemoryPages(region, region_size);
#endif
region = NULL;
region_size = 0;
}

View File

@ -62,6 +62,7 @@ void* AllocateExecutableMemory(size_t size, bool low)
#elif defined(__SYMBIAN32__)
//This function may be called more than once, and we want to create only one big
//memory chunk for all the executable code for the JIT
void* ptr;
if( g_code_chunk == NULL && g_code_heap == NULL)
{
TInt minsize = SYMBIAN_CODECHUNK_SIZE;
@ -69,8 +70,10 @@ void* AllocateExecutableMemory(size_t size, bool low)
g_code_chunk = new RChunk();
g_code_chunk->CreateLocalCode(minsize, maxsize);
g_code_heap = UserHeap::ChunkHeap(*g_code_chunk, minsize, 1, maxsize);
ptr = (void*) g_code_heap->Alloc( size );
}
void* ptr = (void*) g_code_heap->Alloc( size );
else
ptr = g_code_heap->Base();
#else
static char *map_hint = 0;
#if defined(__x86_64__) && !defined(MAP_32BIT)