summaryrefslogtreecommitdiff
path: root/lib/allocator.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/allocator.h')
-rw-r--r--lib/allocator.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/allocator.h b/lib/allocator.h
index 4ac863b224c..a89ba32b09b 100644
--- a/lib/allocator.h
+++ b/lib/allocator.h
@@ -30,16 +30,16 @@ struct allocator
attributes do not work with pointers to functions. See
<http://lists.gnu.org/archive/html/bug-gnulib/2011-04/msg00007.html>. */
- /* Call MALLOC to allocate memory, like 'malloc'. On failure MALLOC
+ /* Call ALLOCATE to allocate memory, like 'malloc'. On failure ALLOCATE
should return NULL, though not necessarily set errno. When given
a zero size it may return NULL even if successful. */
- void *(*malloc) (size_t);
+ void *(*allocate) (size_t);
- /* If nonnull, call REALLOC to reallocate memory, like 'realloc'.
- On failure REALLOC should return NULL, though not necessarily set
+ /* If nonnull, call REALLOCATE to reallocate memory, like 'realloc'.
+ On failure REALLOCATE should return NULL, though not necessarily set
errno. When given a zero size it may return NULL even if
successful. */
- void *(*realloc) (void *, size_t);
+ void *(*reallocate) (void *, size_t);
/* Call FREE to free memory, like 'free'. */
void (*free) (void *);
@@ -50,4 +50,7 @@ struct allocator
void (*die) (void);
};
+/* An allocator using the stdlib functions and a null DIE function. */
+extern struct allocator const stdlib_allocator;
+
#endif