Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions vm/ByteCodeTranslator/src/cn1_globals.m
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,13 @@ void codenameOneGCSweep() {
}

JAVA_BOOLEAN removeObjectFromHeapCollection(CODENAME_ONE_THREAD_STATE, JAVA_OBJECT o) {
// Initialize allObjectsInHeap if it hasn't been initialized yet
// This can happen if GC runs before any objects are allocated
if(allObjectsInHeap == 0) {
allObjectsInHeap = malloc(sizeof(JAVA_OBJECT) * sizeOfAllObjectsInHeap);
memset(allObjectsInHeap, 0, sizeof(JAVA_OBJECT) * sizeOfAllObjectsInHeap);
}

int pos = findPointerPosInHeap(o);

// double deletion might occur when the GC and the reference counting collide
Expand Down
Loading