MCPcopy Index your code
hub / github.com/F-Stack/f-stack / bp_alloc

Function bp_alloc

tools/ipfw/ipfw2.c:433–446  ·  view source on GitHub ↗

* Allocates new buffer of given size @sz. * * Returns 0 on success. */

Source from the content-addressed store, hash-verified

431 * Returns 0 on success.
432 */
433int
434bp_alloc(struct buf_pr *b, size_t size)
435{
436 memset(b, 0, sizeof(struct buf_pr));
437
438 if ((b->buf = calloc(1, size)) == NULL)
439 return (ENOMEM);
440
441 b->ptr = b->buf;
442 b->size = size;
443 b->avail = b->size;
444
445 return (0);
446}
447
448void
449bp_free(struct buf_pr *b)

Callers 3

list_pipesFunction · 0.85
ipfw_show_configFunction · 0.85
ipfw_addFunction · 0.85

Calls 2

memsetFunction · 0.85
callocFunction · 0.85

Tested by

no test coverage detected