PostGIS  2.2.7dev-r@@SVN_REVISION@@
void bytebuffer_destroy ( bytebuffer_t s)

Free the bytebuffer_t and all memory managed within it.

Definition at line 87 of file bytebuffer.c.

References bytebuffer_t::buf_start, bytebuffer_getlength(), LWDEBUG, LWDEBUGF, and lwfree().

Referenced by lwgeom_write_to_buffer().

88 {
89  LWDEBUG(2,"Entered bytebuffer_destroy");
90  LWDEBUGF(4,"The buffer has used %d bytes",bytebuffer_getlength(s));
91 
92  if ( s->buf_start )
93  {
94  LWDEBUGF(4,"let's free buf_start %p",s->buf_start);
95  lwfree(s->buf_start);
96  LWDEBUG(4,"buf_start is freed");
97  }
98  if ( s )
99  {
100  lwfree(s);
101  LWDEBUG(4,"bytebuffer_t is freed");
102  }
103  return;
104 }
void lwfree(void *mem)
Definition: lwutil.c:214
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:50
uint8_t * buf_start
Definition: bytebuffer.h:52
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:55
size_t bytebuffer_getlength(bytebuffer_t *s)
Returns the length of the current buffer.
Definition: bytebuffer.c:337

Here is the call graph for this function:

Here is the caller graph for this function: