We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3b83cfa commit 7462daaCopy full SHA for 7462daa
vm/ByteCodeTranslator/src/cn1_globals.m
@@ -855,6 +855,13 @@ void codenameOneGCSweep() {
855
}
856
857
JAVA_BOOLEAN removeObjectFromHeapCollection(CODENAME_ONE_THREAD_STATE, JAVA_OBJECT o) {
858
+ // Initialize allObjectsInHeap if it hasn't been initialized yet
859
+ // This can happen if GC runs before any objects are allocated
860
+ if(allObjectsInHeap == 0) {
861
+ allObjectsInHeap = malloc(sizeof(JAVA_OBJECT) * sizeOfAllObjectsInHeap);
862
+ memset(allObjectsInHeap, 0, sizeof(JAVA_OBJECT) * sizeOfAllObjectsInHeap);
863
+ }
864
+
865
int pos = findPointerPosInHeap(o);
866
867
// double deletion might occur when the GC and the reference counting collide
0 commit comments