summaryrefslogtreecommitdiff
path: root/src/alloc.c
diff options
context:
space:
mode:
authorJan Djärv <jan.h.d@swipnet.se>2004-12-25 10:31:36 +0000
committerJan Djärv <jan.h.d@swipnet.se>2004-12-25 10:31:36 +0000
commit18df8fc800d727cf8f3ebbc692f53ab1c2fb57ad (patch)
tree0c196258413d8575e785a5ad2254e82f7db19562 /src/alloc.c
parent1fedcd95a3dfa5cfe74c929636d215351dc5db41 (diff)
downloademacs-18df8fc800d727cf8f3ebbc692f53ab1c2fb57ad.tar.gz
Update comment for check_depth.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 143f5c76292..429cdb5246a 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -601,22 +601,24 @@ static char xmalloc_overrun_check_trailer[XMALLOC_OVERRUN_CHECK_SIZE] =
((unsigned)(ptr[-4]) << 24))
-/* The call depth in overrun_check functions. Realloc may call both malloc
- and free. If realloc calls malloc, this may happen:
- overrun_check_realloc()
- -> malloc -> (via hook)_-> emacs_blocked_malloc
- -> overrun_check_malloc
- call malloc (hooks are NULL, so real malloc is called).
- malloc returns 10000.
- add overhead, return 10016.
- <- (back in overrun_check_realloc)
+/* The call depth in overrun_check functions. For example, this might happen:
+ xmalloc()
+ overrun_check_malloc()
+ -> malloc -> (via hook)_-> emacs_blocked_malloc
+ -> overrun_check_malloc
+ call malloc (hooks are NULL, so real malloc is called).
+ malloc returns 10000.
+ add overhead, return 10016.
+ <- (back in overrun_check_malloc)
add overhead again, return 10032
+ xmalloc returns 10032.
(time passes).
- overrun_check_free(10032)
- decrease overhed
- free(10016) <- crash, because 10000 is the original pointer. */
+ xfree(10032)
+ overrun_check_free(10032)
+ decrease overhed
+ free(10016) <- crash, because 10000 is the original pointer. */
static int check_depth;