lib/ofpbuf.c
/* Initializes 'b' as an empty ofpbuf that contains the 'allocated' bytes of
 * memory starting at 'base'.  'base' should point to a buffer on the stack.
 * (Nothing actually relies on 'base' being allocated on the stack.  It could
 * be static or malloc()'d memory.  But stack space is the most common use
 * case.)
 *
 * 'base' should be appropriately aligned.  Using an array of uint32_t or
 * uint64_t for the buffer is a reasonable way to ensure appropriate alignment
 * for 32- or 64-bit data.
 *
 * An ofpbuf operation that requires reallocating data will assert-fail if this
 * function was used to initialize it.  Thus, one need not call ofpbuf_uninit()
 * on an ofpbuf initialized by this function (though doing so is harmless),
 * because it is guaranteed that 'b' does not own any heap-allocated memory. */


'base' should be appropriately aligned.  Using an array of uint32_t or
uint64_t for the buffer is a reasonable way to ensure appropriate alignment
for 32- or 64-bit data.

An ofpbuf operation that requires reallocating data will assert-fail if this
function was used to initialize it.  Thus, one need not call ofpbuf_uninit()
on an ofpbuf initialized by this function (though doing so is harmless),
because it is guaranteed that 'b' does not own any heap-allocated memory.
' base ' should be appropriately aligned . Using an array of uint32_t or uint64_t for the buffer is a reasonable way to ensure appropriate alignment for 32 - or 64 - bit data . An ofpbuf operation that requires reallocating data will assert - fail if this function was used to initialize it . Thus one need not call ofpbuf_uninit () on an ofpbuf initialized by this function ( though doing so is harmless ) because it is guaranteed that ' b ' does not own any heap - allocated memory .
void
ofpbuf_use_stack(struct ofpbuf *b, void *base, size_t allocated)
{
    ofpbuf_use__(b, base, allocated, 0, OFPBUF_STACK);
}
void ofpbuf_use_stack ( struct ofpbuf * b , void * base , size_t allocated ) { ofpbuf_use__ ( b , base , allocated , 0 , OFPBUF_STACK ) ; }
Initializes 'b' as an empty ofpbuf that contains the 'allocated' bytes of
 memory starting at 'base'.
Initializes ' b ' as an empty ofpbuf that contains the ' allocated ' bytes of memory starting at ' base ' .