PostGIS  2.2.7dev-r@@SVN_REVISION@@
void bytebuffer_init_with_size ( bytebuffer_t b,
size_t  size 

Allocate just the internal buffer of an existing bytebuffer_t struct.

Useful for allocating short-lived bytebuffers off the stack.

Definition at line 75 of file bytebuffer.c.

References bytebuffer_t::buf_start, bytebuffer_t::capacity, lwalloc(), bytebuffer_t::readcursor, and bytebuffer_t::writecursor.

Referenced by ptarray_to_twkb_buf().

76 {
77  b->buf_start = lwalloc(size);
78  b->readcursor = b->writecursor = b->buf_start;
79  b->capacity = size;
80  memset(b->buf_start, 0, size);
81 }
uint8_t * writecursor
Definition: bytebuffer.h:53
uint8_t * readcursor
Definition: bytebuffer.h:54
size_t capacity
Definition: bytebuffer.h:51
uint8_t * buf_start
Definition: bytebuffer.h:52
void * lwalloc(size_t size)
Definition: lwutil.c:199

Here is the call graph for this function:

Here is the caller graph for this function: