mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-28 08:11:05 -08:00
Better label for igc-allocated handlers (bug#78941)
* src/igc.c (igc_xzalloc_ambig_with_label): New. (igc_xzalloc_ambig, igc_alloc_handler): Use it.
This commit is contained in:
parent
ec6bac2fbc
commit
e404e90246
2 changed files with 10 additions and 3 deletions
12
src/igc.c
12
src/igc.c
|
|
@ -3396,7 +3396,7 @@ igc_xalloc_raw_exact (size_t n)
|
|||
}
|
||||
|
||||
void *
|
||||
igc_xzalloc_ambig (size_t size)
|
||||
igc_xzalloc_ambig_with_label (size_t size, const char *label)
|
||||
{
|
||||
/* Can't make a root that has zero length. Want one to be able to
|
||||
detect calling igc_free on something not having a root. */
|
||||
|
|
@ -3406,10 +3406,16 @@ igc_xzalloc_ambig (size_t size)
|
|||
size++;
|
||||
void *p = xzalloc (size);
|
||||
void *end = (char *) p + size;
|
||||
root_create_ambig (global_igc, p, end, "xzalloc-ambig");
|
||||
root_create_ambig (global_igc, p, end, label ? label : "igc-xzalloc-ambig");
|
||||
return p;
|
||||
}
|
||||
|
||||
void *
|
||||
igc_xzalloc_ambig (size_t size)
|
||||
{
|
||||
return igc_xzalloc_ambig_with_label (size, NULL);
|
||||
}
|
||||
|
||||
void *
|
||||
igc_xnmalloc_ambig (ptrdiff_t nitems, ptrdiff_t item_size)
|
||||
{
|
||||
|
|
@ -4648,7 +4654,7 @@ igc_alloc_blv (void)
|
|||
void *
|
||||
igc_alloc_handler (void)
|
||||
{
|
||||
struct handler *h = igc_xzalloc_ambig (sizeof *h);
|
||||
struct handler *h = igc_xzalloc_ambig_with_label (sizeof *h, "handler");
|
||||
return h;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -85,6 +85,7 @@ void *igc_alloc_global_ref (void);
|
|||
struct Lisp_Buffer_Local_Value *igc_alloc_blv (void);
|
||||
void *igc_alloc_handler (void);
|
||||
void *igc_xzalloc_ambig (size_t size);
|
||||
void *igc_xzalloc_ambig_with_label (size_t size, const char *label);
|
||||
void *igc_realloc_ambig (void *block, size_t size);
|
||||
#ifdef ENABLE_CHECKING
|
||||
void igc_check_freeable (void *p);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue