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); ...@@ -100,7 +100,6 @@ unsigned long alloc_size(void *pool, unsigned long poolsize, void *p);
* *
* Example: * Example:
* #include <assert.h> * #include <assert.h>
*
* ... * ...
* assert(alloc_check(pool, 32*1024*1024)); * assert(alloc_check(pool, 32*1024*1024));
*/ */
...@@ -117,15 +116,12 @@ bool alloc_check(void *pool, unsigned long poolsize); ...@@ -117,15 +116,12 @@ bool alloc_check(void *pool, unsigned long poolsize);
* suspect corruption call alloc_check() first. * suspect corruption call alloc_check() first.
* *
* Example: * Example:
* #include <stdio.h> * d = alloc_get(pool, 32*1024*1024, sizeof(*d), ALIGNOF(*d));
*
* double *d = alloc_get(pool, 32*1024*1024,
* sizeof(*d), ALIGNOF(*d));
* if (!d) { * if (!d) {
* fprintf(stderr, "Allocation failed!\n"); * fprintf(stderr, "Allocation failed!\n");
* if (!alloc_check(pool, 32*1024*1024)) * if (!alloc_check(pool, 32*1024*1024))
* errx(1, "Allocation pool is corrupt"); * errx(1, "Allocation pool is corrupt");
* alloc_visualize(stderr, pool, 32*1024*1024)); * alloc_visualize(stderr, pool, 32*1024*1024);
* exit(1); * 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