Skip to content
Snippets Groups Projects
Commit 61924a99 authored by Dan Egnor's avatar Dan Egnor
Browse files

Clarify allocation hooks

parent e84f2c63
Branches
Tags
No related merge requests found
...@@ -29,9 +29,9 @@ extern void (*oop_free)(void *ptr); /* <em>Free allocated memory.</em> */ ...@@ -29,9 +29,9 @@ extern void (*oop_free)(void *ptr); /* <em>Free allocated memory.</em> */
These are global function pointers, initialized by default to the standard C These are global function pointers, initialized by default to the standard C
library functions <em>malloc</em>, <em>realloc</em>, and <em>free</em>. library functions <em>malloc</em>, <em>realloc</em>, and <em>free</em>.
Applications using liboop may reset these pointers to allocation and Applications using liboop may reset these pointers to allocation and
deallocation routines with a compatible interface; components should use deallocation routines with a compatible interface; libraries should use
these function pointers wherever possible to allocate and release memory. these function pointers wherever possible to allocate and release memory.
These pointers are normally set before calling any liboop components; if they These pointers are normally set before calling any liboop code; if they
are changed during operation, the new <em>oop_free</em> and are changed during operation, the new <em>oop_free</em> and
<em>oop_realloc</em> functions should be <em>oop_realloc</em> functions should be
capable of handling memory obtained with the old <em>oop_malloc</em>. capable of handling memory obtained with the old <em>oop_malloc</em>.
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<pre> <pre>
#include &lt;oop.h&gt; #include &lt;oop.h&gt;
/* <em>For recommended use by oop components.</em> */ /* <em>Applications can set these; liboop libraries will use them.</em> */
extern void *(*<a href="alloc">oop_malloc</a>)(size_t); /* <em>returns NULL on failure</em> */ extern void *(*<a href="alloc">oop_malloc</a>)(size_t); /* <em>returns NULL on failure</em> */
extern void *(*<a href="alloc">oop_realloc</a>)(void *,size_t); /* <em>returns NULL on failure</em> */ extern void *(*<a href="alloc">oop_realloc</a>)(void *,size_t); /* <em>returns NULL on failure</em> */
extern void (*<a href="alloc">oop_free</a>)(void *); extern void (*<a href="alloc">oop_free</a>)(void *);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment