update Sat Sep 12 12:37:01 PDT 2009
[pkgsrc.git] / wip / elinks-libmm / patches / patch-al
1 $NetBSD$
2
3 --- src/util/memory.h.orig      2008-02-16 18:45:03.000000000 -0500
4 +++ src/util/memory.h
5 @@ -11,8 +11,10 @@
6  /** Delay in seconds between each alloc try. */
7  #define ALLOC_DELAY 3
8  
9 -#define fmem_alloc(x) mem_alloc(x)
10 -#define fmem_free(x) mem_free(x)
11 +#include "malloca.h"
12 +
13 +#define fmem_alloc(x) safe_alloca(x)
14 +#define fmem_free(x) freea(x)
15  
16  
17  /** Cygwin wants some size_t definition here... let's try to make it happy
18 @@ -24,6 +26,7 @@
19  #include <gc.h>
20  #endif
21  
22 +
23  #ifdef HAVE_MMAP
24  void *mem_mmap_alloc(size_t size);
25  void mem_mmap_free(void *p, size_t size);
26 @@ -85,24 +88,6 @@ void *mem_realloc(void *, size_t);
27   * inside a function.
28   * See alloca(3) manpage. */
29  
30 -#undef fmem_alloc
31 -#undef fmem_free
32 -
33 -#ifdef HAVE_ALLOCA
34 -
35 -#ifdef HAVE_ALLOCA_H
36 -#include <alloca.h>
37 -#endif
38 -#define fmem_alloc(x) alloca(x)
39 -#define fmem_free(x)
40 -
41 -#else /* HAVE_ALLOCA */
42 -
43 -#define fmem_alloc(x) mem_alloc(x)
44 -#define fmem_free(x) mem_free(x)
45 -
46 -#endif /* HAVE_ALLOCA */
47 -
48  #endif /* CONFIG_FASTMEM */
49  
50  #endif /* DEBUG_MEMLEAK */