mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-29 17:22:56 +08:00
fix freeList overflow
Signed-off-by: 李昂 <liang6516@outlook.com>
This commit is contained in:
parent
f263499c93
commit
efa05822a4
@ -1820,6 +1820,9 @@ uint32_t pikaGC_markSweepOnce(PikaGC* gc) {
|
||||
PikaObj* obj = g_PikaObjState.gcChain;
|
||||
while (NULL != obj) {
|
||||
if (!obj_getFlag(obj, OBJ_FLAG_GC_MARKED)) {
|
||||
if (count > dimof(freeList) - 1){
|
||||
break;
|
||||
}
|
||||
freeList[count] = obj;
|
||||
count++;
|
||||
}
|
||||
@ -1829,6 +1832,8 @@ uint32_t pikaGC_markSweepOnce(PikaGC* gc) {
|
||||
// pikaGC_markDump();
|
||||
// pikaGC_printFreeList();
|
||||
for (uint32_t i = 0; i < count; i++) {
|
||||
pika_platform_printf("GC Free:");
|
||||
obj_dump(freeList[i]);
|
||||
obj_GC(freeList[i]);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user