PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ bytebuffer_destroy()

void bytebuffer_destroy ( bytebuffer_t s)

Free the bytebuffer_t and all memory managed within it.

Definition at line 75 of file bytebuffer.c.

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

Referenced by lwgeom_write_to_buffer().

76 {
77  LWDEBUG(2,"Entered bytebuffer_destroy");
78  LWDEBUGF(4,"The buffer has used %d bytes",bytebuffer_getlength(s));
79 
80  if ( s->buf_start )
81  {
82  LWDEBUGF(4,"let's free buf_start %p",s->buf_start);
83  lwfree(s->buf_start);
84  LWDEBUG(4,"buf_start is freed");
85  }
86  if ( s )
87  {
88  lwfree(s);
89  LWDEBUG(4,"bytebuffer_t is freed");
90  }
91  return;
92 }
void lwfree(void *mem)
Definition: lwutil.c:242
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:83
uint8_t * buf_start
Definition: bytebuffer.h:40
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:88
size_t bytebuffer_getlength(bytebuffer_t *s)
Returns the length of the current buffer.
Definition: bytebuffer.c:325
Here is the call graph for this function:
Here is the caller graph for this function: