2006-02-20 Chong Yidong <cyd@stupidchicken.com>
- * regex.c (xmalloc, xrealloc): Define these when not linked to
- Emacs.
+ * regex.c: Revert 2006-02-19 change.
+ (xmalloc, xrealloc): Define these when not linked to Emacs.
+ Redefine malloc -> xmalloc, realloc -> xrealloc as in Emacs case.
2006-02-19 Luc Teirlinck <teirllm@auburn.edu>
return val;
}
+# ifdef malloc
+# undef malloc
+# endif
+# define malloc xmalloc
+# ifdef realloc
+# undef realloc
+# endif
+# define realloc xrealloc
+
/* When used in Emacs's lib-src, we need to get bzero and bcopy somehow.
If nothing else has been done, use the method below. */
# ifdef INHIBIT_STRING_HEADER
work_area->allocated += 16 * sizeof (int);
if (work_area->table)
work_area->table
- = (int *) xrealloc (work_area->table, work_area->allocated);
+ = (int *) realloc (work_area->table, work_area->allocated);
else
work_area->table
- = (int *) xmalloc (work_area->allocated);
+ = (int *) malloc (work_area->allocated);
}
#ifdef emacs
if (! fail_stack.stack)
fail_stack.stack
- = (fail_stack_elt_t *) xmalloc (fail_stack.size
+ = (fail_stack_elt_t *) malloc (fail_stack.size
* sizeof (fail_stack_elt_t));
else
fail_stack.stack
- = (fail_stack_elt_t *) xrealloc (fail_stack.stack,
+ = (fail_stack_elt_t *) realloc (fail_stack.stack,
(fail_stack.size
* sizeof (fail_stack_elt_t)));
}
preg->used = 0;
/* Try to allocate space for the fastmap. */
- preg->fastmap = (char *) xmalloc (1 << BYTEWIDTH);
+ preg->fastmap = (char *) malloc (1 << BYTEWIDTH);
if (cflags & REG_ICASE)
{
unsigned i;
preg->translate
- = (RE_TRANSLATE_TYPE) xmalloc (CHAR_SET_SIZE
+ = (RE_TRANSLATE_TYPE) malloc (CHAR_SET_SIZE
* sizeof (*(RE_TRANSLATE_TYPE)0));
if (preg->translate == NULL)
return (int) REG_ESPACE;