]> code.delx.au - gnu-emacs/blobdiff - lib/allocator.h
Replace eldoc-documentation-function with a hook
[gnu-emacs] / lib / allocator.h
index a89ba32b09b1eda6c4d933a087bd327351bdfa73..1f1eab6a03342153a602b2e32964955320099181 100644 (file)
@@ -1,6 +1,6 @@
 /* Memory allocators such as malloc+free.
 
-   Copyright (C) 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011-2016 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -18,6 +18,7 @@
 /* Written by Paul Eggert.  */
 
 #ifndef _GL_ALLOCATOR_H
+#define _GL_ALLOCATOR_H
 
 #include <stddef.h>
 
@@ -44,13 +45,14 @@ struct allocator
   /* Call FREE to free memory, like 'free'.  */
   void (*free) (void *);
 
-  /* If nonnull, call DIE if MALLOC or REALLOC fails.  DIE should not
-     return.  DIE can be used by code that detects memory overflow
-     while calculating sizes to be passed to MALLOC or REALLOC.  */
-  void (*die) (void);
+  /* If nonnull, call DIE (SIZE) if MALLOC (SIZE) or REALLOC (...,
+     SIZE) fails.  DIE should not return.  SIZE should equal SIZE_MAX
+     if size_t overflow was detected while calculating sizes to be
+     passed to MALLOC or REALLOC.  */
+  void (*die) (size_t);
 };
 
 /* An allocator using the stdlib functions and a null DIE function.  */
 extern struct allocator const stdlib_allocator;
 
-#endif
+#endif /* _GL_ALLOCATOR_H */