aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChong Yidong2006-02-20 16:44:09 +0000
committerChong Yidong2006-02-20 16:44:09 +0000
commita073faa64c7fd0d5b6c21439cfcf08f9a36b4905 (patch)
tree714e276bd96cab1a7193cd2fdccd6eb9562728c2 /src
parenta77f947b23c1cc19f049b2d70b930f974bde6540 (diff)
downloademacs-a073faa64c7fd0d5b6c21439cfcf08f9a36b4905.tar.gz
emacs-a073faa64c7fd0d5b6c21439cfcf08f9a36b4905.zip
* regex.c: Revert 2006-02-19 change.
Redefine malloc -> xmalloc, realloc -> xrealloc as in Emacs case.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/regex.c21
2 files changed, 18 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 1ed2e8512e2..e922586bde2 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,7 +1,8 @@
12006-02-20 Chong Yidong <cyd@stupidchicken.com> 12006-02-20 Chong Yidong <cyd@stupidchicken.com>
2 2
3 * regex.c (xmalloc, xrealloc): Define these when not linked to 3 * regex.c: Revert 2006-02-19 change.
4 Emacs. 4 (xmalloc, xrealloc): Define these when not linked to Emacs.
5 Redefine malloc -> xmalloc, realloc -> xrealloc as in Emacs case.
5 6
62006-02-19 Luc Teirlinck <teirllm@auburn.edu> 72006-02-19 Luc Teirlinck <teirllm@auburn.edu>
7 8
diff --git a/src/regex.c b/src/regex.c
index 9cc6c8c08ee..cde361e62ce 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -217,6 +217,15 @@ xrealloc (block, size)
217 return val; 217 return val;
218} 218}
219 219
220# ifdef malloc
221# undef malloc
222# endif
223# define malloc xmalloc
224# ifdef realloc
225# undef realloc
226# endif
227# define realloc xrealloc
228
220/* When used in Emacs's lib-src, we need to get bzero and bcopy somehow. 229/* When used in Emacs's lib-src, we need to get bzero and bcopy somehow.
221 If nothing else has been done, use the method below. */ 230 If nothing else has been done, use the method below. */
222# ifdef INHIBIT_STRING_HEADER 231# ifdef INHIBIT_STRING_HEADER
@@ -2103,10 +2112,10 @@ extend_range_table_work_area (work_area)
2103 work_area->allocated += 16 * sizeof (int); 2112 work_area->allocated += 16 * sizeof (int);
2104 if (work_area->table) 2113 if (work_area->table)
2105 work_area->table 2114 work_area->table
2106 = (int *) xrealloc (work_area->table, work_area->allocated); 2115 = (int *) realloc (work_area->table, work_area->allocated);
2107 else 2116 else
2108 work_area->table 2117 work_area->table
2109 = (int *) xmalloc (work_area->allocated); 2118 = (int *) malloc (work_area->allocated);
2110} 2119}
2111 2120
2112#ifdef emacs 2121#ifdef emacs
@@ -3644,11 +3653,11 @@ regex_compile (pattern, size, syntax, bufp)
3644 3653
3645 if (! fail_stack.stack) 3654 if (! fail_stack.stack)
3646 fail_stack.stack 3655 fail_stack.stack
3647 = (fail_stack_elt_t *) xmalloc (fail_stack.size 3656 = (fail_stack_elt_t *) malloc (fail_stack.size
3648 * sizeof (fail_stack_elt_t)); 3657 * sizeof (fail_stack_elt_t));
3649 else 3658 else
3650 fail_stack.stack 3659 fail_stack.stack
3651 = (fail_stack_elt_t *) xrealloc (fail_stack.stack, 3660 = (fail_stack_elt_t *) realloc (fail_stack.stack,
3652 (fail_stack.size 3661 (fail_stack.size
3653 * sizeof (fail_stack_elt_t))); 3662 * sizeof (fail_stack_elt_t)));
3654 } 3663 }
@@ -6328,14 +6337,14 @@ regcomp (preg, pattern, cflags)
6328 preg->used = 0; 6337 preg->used = 0;
6329 6338
6330 /* Try to allocate space for the fastmap. */ 6339 /* Try to allocate space for the fastmap. */
6331 preg->fastmap = (char *) xmalloc (1 << BYTEWIDTH); 6340 preg->fastmap = (char *) malloc (1 << BYTEWIDTH);
6332 6341
6333 if (cflags & REG_ICASE) 6342 if (cflags & REG_ICASE)
6334 { 6343 {
6335 unsigned i; 6344 unsigned i;
6336 6345
6337 preg->translate 6346 preg->translate
6338 = (RE_TRANSLATE_TYPE) xmalloc (CHAR_SET_SIZE 6347 = (RE_TRANSLATE_TYPE) malloc (CHAR_SET_SIZE
6339 * sizeof (*(RE_TRANSLATE_TYPE)0)); 6348 * sizeof (*(RE_TRANSLATE_TYPE)0));
6340 if (preg->translate == NULL) 6349 if (preg->translate == NULL)
6341 return (int) REG_ESPACE; 6350 return (int) REG_ESPACE;