소스 검색

LibC: Notify UE at the start of free() instead of at the end

This way, if we end up deallocating an entire ChunkedBlock, UE doesn't
get confused thinking the freed pointer has never been allocated.
Andreas Kling 4 년 전
부모
커밋
fe79b9ff94
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      Libraries/LibC/malloc.cpp

+ 1 - 1
Libraries/LibC/malloc.cpp

@@ -377,8 +377,8 @@ static void free_impl(void* ptr)
 {
 {
     if (s_profiling)
     if (s_profiling)
         perf_event(PERF_EVENT_FREE, reinterpret_cast<FlatPtr>(ptr), 0);
         perf_event(PERF_EVENT_FREE, reinterpret_cast<FlatPtr>(ptr), 0);
-    free_impl(ptr);
     ue_notify_free(ptr);
     ue_notify_free(ptr);
+    free_impl(ptr);
 }
 }
 
 
 void* calloc(size_t count, size_t size)
 void* calloc(size_t count, size_t size)