601 |
((unsigned)(ptr[-4]) << 24)) |
((unsigned)(ptr[-4]) << 24)) |
602 |
|
|
603 |
|
|
604 |
/* The call depth in overrun_check functions. Realloc may call both malloc |
/* The call depth in overrun_check functions. For example, this might happen: |
605 |
and free. If realloc calls malloc, this may happen: |
xmalloc() |
606 |
overrun_check_realloc() |
overrun_check_malloc() |
607 |
-> malloc -> (via hook)_-> emacs_blocked_malloc |
-> malloc -> (via hook)_-> emacs_blocked_malloc |
608 |
-> overrun_check_malloc |
-> overrun_check_malloc |
609 |
call malloc (hooks are NULL, so real malloc is called). |
call malloc (hooks are NULL, so real malloc is called). |
610 |
malloc returns 10000. |
malloc returns 10000. |
611 |
add overhead, return 10016. |
add overhead, return 10016. |
612 |
<- (back in overrun_check_realloc) |
<- (back in overrun_check_malloc) |
613 |
add overhead again, return 10032 |
add overhead again, return 10032 |
614 |
|
xmalloc returns 10032. |
615 |
|
|
616 |
(time passes). |
(time passes). |
617 |
|
|
618 |
overrun_check_free(10032) |
xfree(10032) |
619 |
decrease overhed |
overrun_check_free(10032) |
620 |
free(10016) <- crash, because 10000 is the original pointer. */ |
decrease overhed |
621 |
|
free(10016) <- crash, because 10000 is the original pointer. */ |
622 |
|
|
623 |
static int check_depth; |
static int check_depth; |
624 |
|
|