aboutsummaryrefslogtreecommitdiffstats
path: root/src/regex.c
diff options
context:
space:
mode:
authorMiles Bader2006-02-22 06:54:10 +0000
committerMiles Bader2006-02-22 06:54:10 +0000
commitb434f199dbbc2694a69538ee95e5e583f6357f71 (patch)
treeea87d2540063659d9cfdb24462bb4c0336a6ec47 /src/regex.c
parent9d826e0eaf8a4e2f1cf5aac74d6b02ccc393af8d (diff)
parenta1b24e137f75b9f5fdbd5526947a70c462c5e5bf (diff)
downloademacs-b434f199dbbc2694a69538ee95e5e583f6357f71.tar.gz
emacs-b434f199dbbc2694a69538ee95e5e583f6357f71.zip
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-21
Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 97-112) - Update from CVS - Merge from erc--emacs--0 - Update from CVS: src/regex.c (extend_range_table_work_area): Fix typo. - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 37) - Update from CVS
Diffstat (limited to 'src/regex.c')
-rw-r--r--src/regex.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/regex.c b/src/regex.c
index 3548ad3c048..48baacd81e2 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -197,6 +197,51 @@ char *malloc ();
197char *realloc (); 197char *realloc ();
198# endif 198# endif
199 199
200/* When used in Emacs's lib-src, we need xmalloc and xrealloc. */
201
202void *
203xmalloc (size)
204 size_t size;
205{
206 register void *val;
207 val = (void *) malloc (size);
208 if (!val && size)
209 {
210 write (2, "virtual memory exhausted\n", 25);
211 exit (1);
212 }
213 return val;
214}
215
216void *
217xrealloc (block, size)
218 void *block;
219 size_t size;
220{
221 register void *val;
222 /* We must call malloc explicitly when BLOCK is 0, since some
223 reallocs don't do this. */
224 if (! block)
225 val = (void *) malloc (size);
226 else
227 val = (void *) realloc (block, size);
228 if (!val && size)
229 {
230 write (2, "virtual memory exhausted\n", 25);
231 exit (1);
232 }
233 return val;
234}
235
236# ifdef malloc
237# undef malloc
238# endif
239# define malloc xmalloc
240# ifdef realloc
241# undef realloc
242# endif
243# define realloc xrealloc
244
200/* When used in Emacs's lib-src, we need to get bzero and bcopy somehow. 245/* When used in Emacs's lib-src, we need to get bzero and bcopy somehow.
201 If nothing else has been done, use the method below. */ 246 If nothing else has been done, use the method below. */
202# ifdef INHIBIT_STRING_HEADER 247# ifdef INHIBIT_STRING_HEADER