PostGIS 3.0.6dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ stringbuffer_makeroom()

static void stringbuffer_makeroom ( stringbuffer_t s,
size_t  size_to_add 
)
inlinestatic

If necessary, expand the stringbuffer_t internal buffer to accommodate the specified additional size.

Definition at line 68 of file stringbuffer.h.

69{
70 size_t current_size = (s->str_end - s->str_start);
71 size_t capacity = s->capacity;
72 size_t required_size = current_size + size_to_add;
73
74 while (capacity < required_size)
75 capacity *= 2;
76
77 if (capacity > s->capacity)
78 {
79 s->str_start = lwrealloc(s->str_start, capacity);
80 s->capacity = capacity;
81 s->str_end = s->str_start + current_size;
82 }
83}
char * s
Definition cu_in_wkt.c:23
void * lwrealloc(void *mem, size_t size)
Definition lwutil.c:235

References lwrealloc(), and s.

Referenced by stringbuffer_append(), and stringbuffer_avprintf().

Here is the call graph for this function:
Here is the caller graph for this function: