about summary refs log tree commit diff
path: root/malloc
diff options
context:
space:
mode:
Diffstat (limited to 'malloc')
-rw-r--r--malloc/arena.c4
-rw-r--r--malloc/malloc.c6
2 files changed, 9 insertions, 1 deletions
diff --git a/malloc/arena.c b/malloc/arena.c
index 9ace186f5a..d81ed0d680 100644
--- a/malloc/arena.c
+++ b/malloc/arena.c
@@ -581,6 +581,7 @@ new_heap(size_t size, size_t top_pad)
   h->size = size;
   h->mprotect_size = size;
   THREAD_STAT(stat_n_heaps++);
+  LIBC_PROBE (memory_heap_new, 2, h, h->size);
   return h;
 }
 
@@ -606,6 +607,7 @@ grow_heap(heap_info *h, long diff)
   }
 
   h->size = new_size;
+  LIBC_PROBE (memory_heap_more, 2, h, h->size);
   return 0;
 }
 
@@ -633,6 +635,7 @@ shrink_heap(heap_info *h, long diff)
   /*fprintf(stderr, "shrink %p %08lx\n", h, new_size);*/
 
   h->size = new_size;
+  LIBC_PROBE (memory_heap_less, 2, h, h->size);
   return 0;
 }
 
@@ -674,6 +677,7 @@ heap_trim(heap_info *heap, size_t pad)
       break;
     ar_ptr->system_mem -= heap->size;
     arena_mem -= heap->size;
+    LIBC_PROBE (memory_heap_free, 2, heap, heap->size);
     delete_heap(heap);
     heap = prev_heap;
     if(!prev_inuse(p)) { /* consolidate backward */
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 5b4fcff70e..29382340cf 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -2448,8 +2448,10 @@ static void* sysmalloc(INTERNAL_SIZE_T nb, mstate av)
     below even if we cannot call MORECORE.
   */
 
-  if (size > 0)
+  if (size > 0) {
     brk = (char*)(MORECORE(size));
+    LIBC_PROBE (memory_sbrk_more, 2, brk, size);
+  }
 
   if (brk != (char*)(MORECORE_FAILURE)) {
     /* Call the `morecore' hook if necessary.  */
@@ -2747,6 +2749,8 @@ static int systrim(size_t pad, mstate av)
 	(*hook) ();
       new_brk = (char*)(MORECORE(0));
 
+      LIBC_PROBE (memory_sbrk_less, 2, new_brk, extra);
+
       if (new_brk != (char*)MORECORE_FAILURE) {
 	released = (long)(current_brk - new_brk);