PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ bytebuffer_init_with_size()

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 63 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().

64 {
65  b->buf_start = lwalloc(size);
66  b->readcursor = b->writecursor = b->buf_start;
67  b->capacity = size;
68  memset(b->buf_start, 0, size);
69 }
uint8_t * writecursor
Definition: bytebuffer.h:41
uint8_t * readcursor
Definition: bytebuffer.h:42
size_t capacity
Definition: bytebuffer.h:39
uint8_t * buf_start
Definition: bytebuffer.h:40
void * lwalloc(size_t size)
Definition: lwutil.c:227
Here is the call graph for this function:
Here is the caller graph for this function: