Commit 10dda305 authored by Rusty Russell's avatar Rusty Russell

alloc: fix examples so they compile.

parent 43652dec
......@@ -100,7 +100,6 @@ unsigned long alloc_size(void *pool, unsigned long poolsize, void *p);
*
* Example:
* #include <assert.h>
*
* ...
* assert(alloc_check(pool, 32*1024*1024));
*/
......@@ -117,15 +116,12 @@ bool alloc_check(void *pool, unsigned long poolsize);
* suspect corruption call alloc_check() first.
*
* Example:
* #include <stdio.h>
*
* double *d = alloc_get(pool, 32*1024*1024,
* sizeof(*d), ALIGNOF(*d));
* d = alloc_get(pool, 32*1024*1024, sizeof(*d), ALIGNOF(*d));
* if (!d) {
* fprintf(stderr, "Allocation failed!\n");
* if (!alloc_check(pool, 32*1024*1024))
* errx(1, "Allocation pool is corrupt");
* alloc_visualize(stderr, pool, 32*1024*1024));
* alloc_visualize(stderr, pool, 32*1024*1024);
* exit(1);
* }
*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment