ソースを参照

memalign(): have locks while updating statistics

Ioannis Koutras 12 年 前
コミット
296f34e629
共有1 個のファイルを変更した2 個の追加0 個の削除を含む
  1. 2 0
      src/memalign.c

+ 2 - 0
src/memalign.c

@@ -169,12 +169,14 @@ CheckAlignment:
 #endif /* WITH_DEBUG */
 
 #ifdef WITH_ALLOCATOR_STATS
+                LOCK_GLOBAL();
                 update_stats(&systemallocator.dmm_stats,
                         MALLOC,
 #ifdef REQUEST_SIZE_INFO
                         size,
 #endif /* REQUEST_SIZE_INFO */
                         size + sizeof(raw_block_header_t));
+                UNLOCK_GLOBAL();
 #endif /* WITH_ALLOCATOR_STATS */
 
                 *memptr = (void *)((uintptr_t) *memptr + sizeof(raw_block_header_t));