comparison src/regex.c @ 12478:533b6d02cf04

Don't use relocatable allocator.
author Richard M. Stallman <rms@gnu.org>
date Fri, 07 Jul 1995 13:20:16 +0000
parents 444c5079cb22
children 5e531668336e
comparison
equal deleted inserted replaced
12477:8b884d5e7b6a 12478:533b6d02cf04
258 258
259 #endif /* not REGEX_MALLOC */ 259 #endif /* not REGEX_MALLOC */
260 260
261 /* Define how to allocate the failure stack. */ 261 /* Define how to allocate the failure stack. */
262 262
263 #ifdef REL_ALLOC 263 #if defined (REL_ALLOC) && !defined (REGEX_MALLOC)
264
264 #define REGEX_ALLOCATE_STACK(size) \ 265 #define REGEX_ALLOCATE_STACK(size) \
265 r_alloc (&failure_stack_ptr, (size)) 266 r_alloc (&failure_stack_ptr, (size))
266 #define REGEX_REALLOCATE_STACK(source, osize, nsize) \ 267 #define REGEX_REALLOCATE_STACK(source, osize, nsize) \
267 r_re_alloc (&failure_stack_ptr, (nsize)) 268 r_re_alloc (&failure_stack_ptr, (nsize))
268 #define REGEX_FREE_STACK(ptr) \ 269 #define REGEX_FREE_STACK(ptr) \
269 r_alloc_free (&failure_stack_ptr) 270 r_alloc_free (&failure_stack_ptr)
270 271
271 #else /* not REL_ALLOC */ 272 #else /* not using relocating allocator */
272 273
273 #ifdef REGEX_MALLOC 274 #ifdef REGEX_MALLOC
274 275
275 #define REGEX_ALLOCATE_STACK malloc 276 #define REGEX_ALLOCATE_STACK malloc
276 #define REGEX_REALLOCATE_STACK(source, osize, nsize) realloc (source, nsize) 277 #define REGEX_REALLOCATE_STACK(source, osize, nsize) realloc (source, nsize)
284 REGEX_REALLOCATE (source, osize, nsize) 285 REGEX_REALLOCATE (source, osize, nsize)
285 /* No need to explicitly free anything. */ 286 /* No need to explicitly free anything. */
286 #define REGEX_FREE_STACK(arg) 287 #define REGEX_FREE_STACK(arg)
287 288
288 #endif /* not REGEX_MALLOC */ 289 #endif /* not REGEX_MALLOC */
289 #endif /* not REL_ALLOC */ 290 #endif /* not using relocating allocator */
290 291
291 292
292 /* True if `size1' is non-NULL and PTR is pointing anywhere inside 293 /* True if `size1' is non-NULL and PTR is pointing anywhere inside
293 `string1' or just past its end. This works if PTR is NULL, which is 294 `string1' or just past its end. This works if PTR is NULL, which is
294 a good thing. */ 295 a good thing. */