aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorTomohiro Matsuyama2012-08-22 15:38:59 +0900
committerTomohiro Matsuyama2012-08-22 15:38:59 +0900
commitc2d7786e1272a10c62de7bd1c2d8810e510b3ab1 (patch)
tree4dc621ccee2315e7c2af7fcb1e153175b7e7519b /src/alloc.c
parent37219830c704441dad626b2e555e27a7f4676d87 (diff)
downloademacs-c2d7786e1272a10c62de7bd1c2d8810e510b3ab1.tar.gz
emacs-c2d7786e1272a10c62de7bd1c2d8810e510b3ab1.zip
Add emacs native profiler.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/alloc.c b/src/alloc.c
index f0da9416ece..3a4a8de90f5 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -727,6 +727,7 @@ xmalloc (size_t size)
727 727
728 if (!val && size) 728 if (!val && size)
729 memory_full (size); 729 memory_full (size);
730 MALLOC_PROBE (size);
730 return val; 731 return val;
731} 732}
732 733
@@ -744,6 +745,7 @@ xzalloc (size_t size)
744 if (!val && size) 745 if (!val && size)
745 memory_full (size); 746 memory_full (size);
746 memset (val, 0, size); 747 memset (val, 0, size);
748 MALLOC_PROBE (size);
747 return val; 749 return val;
748} 750}
749 751
@@ -765,6 +767,7 @@ xrealloc (void *block, size_t size)
765 767
766 if (!val && size) 768 if (!val && size)
767 memory_full (size); 769 memory_full (size);
770 MALLOC_PROBE (size);
768 return val; 771 return val;
769} 772}
770 773
@@ -955,6 +958,7 @@ lisp_malloc (size_t nbytes, enum mem_type type)
955 MALLOC_UNBLOCK_INPUT; 958 MALLOC_UNBLOCK_INPUT;
956 if (!val && nbytes) 959 if (!val && nbytes)
957 memory_full (nbytes); 960 memory_full (nbytes);
961 MALLOC_PROBE (nbytes);
958 return val; 962 return val;
959} 963}
960 964
@@ -1160,6 +1164,8 @@ lisp_align_malloc (size_t nbytes, enum mem_type type)
1160 1164
1161 MALLOC_UNBLOCK_INPUT; 1165 MALLOC_UNBLOCK_INPUT;
1162 1166
1167 MALLOC_PROBE (nbytes);
1168
1163 eassert (0 == ((uintptr_t) val) % BLOCK_ALIGN); 1169 eassert (0 == ((uintptr_t) val) % BLOCK_ALIGN);
1164 return val; 1170 return val;
1165} 1171}
@@ -1340,6 +1346,8 @@ emacs_blocked_malloc (size_t size, const void *ptr)
1340 __malloc_hook = emacs_blocked_malloc; 1346 __malloc_hook = emacs_blocked_malloc;
1341 UNBLOCK_INPUT_ALLOC; 1347 UNBLOCK_INPUT_ALLOC;
1342 1348
1349 MALLOC_PROBE (size);
1350
1343 /* fprintf (stderr, "%p malloc\n", value); */ 1351 /* fprintf (stderr, "%p malloc\n", value); */
1344 return value; 1352 return value;
1345} 1353}
@@ -5510,6 +5518,8 @@ See Info node `(elisp)Garbage Collection'. */)
5510 mark_backtrace (); 5518 mark_backtrace ();
5511#endif 5519#endif
5512 5520
5521 mark_profiler ();
5522
5513#ifdef HAVE_WINDOW_SYSTEM 5523#ifdef HAVE_WINDOW_SYSTEM
5514 mark_fringe_data (); 5524 mark_fringe_data ();
5515#endif 5525#endif