@@ -772,10 +772,12 @@ gc_alloc_wo_internal(void *vheap, gc_size_t size, const char *file, int line)
/* integer overflow */
return NULL;
+#if BH_ENABLE_GC_CORRUPTION_CHECK != 0
if (heap->is_heap_corrupted) {
os_printf("[GC_ERROR]Heap is corrupted, allocate memory failed.\n");
}
+#endif
LOCK_HEAP(heap);
@@ -11,7 +11,13 @@ if (WAMR_BUILD_GC_VERIFY EQUAL 1)
endif ()
if (NOT DEFINED WAMR_BUILD_GC_CORRUPTION_CHECK)
- set (WAMR_BUILD_GC_CORRUPTION_CHECK 1)
+ # Disable memory allocator heap corruption check
+ # when GC is enabled
+ if (WAMR_BUILD_GC EQUAL 1)
+ set (WAMR_BUILD_GC_CORRUPTION_CHECK 0)
+ else ()
+ set (WAMR_BUILD_GC_CORRUPTION_CHECK 1)
+ endif ()
if (WAMR_BUILD_GC_CORRUPTION_CHECK EQUAL 0)