Graphviz 13.0.0~dev.20241220.2304
|
#include <agxbuf.h>
Data Fields | ||
union { | ||
struct { | ||
char * buf | ||
start of buffer More... | ||
size_t size | ||
number of characters in the buffer More... | ||
size_t capacity | ||
available bytes in the buffer More... | ||
char padding [sizeof(size_t) - 1] | ||
unused; for alignment More... | ||
unsigned char located | ||
where does the backing memory for this buffer live? More... | ||
} s | ||
char store [sizeof(char *)+sizeof(size_t) *3 - 1] | ||
} | u | |
extensible buffer
Malloc'ed memory is never released until agxbdisown
or agxbfree
is called.
This has the following layout assuming x86-64.
located ↓
┌───────────────┬───────────────┬───────────────┬─────────────┬─┐ │ buf │ size │ capacity │ padding │ │ ├───────────────┴───────────────┴───────────────┴─────────────┼─┤ │ store │ │ └─────────────────────────────────────────────────────────────┴─┘ 0 8 16 24 32
buf
, size
, and capacity
are in use when located
is AGXBUF_ON_HEAP
. store
is in use when located
is < AGXBUF_ON_HEAP
.
char* agxbuf::buf |
Definition at line 57 of file agxbuf.h.
Referenced by agxbdisown(), agxbfree(), agxbmore(), agxbnext(), agxbpop(), agxbput_n(), agxbputc(), and agxbstart().
size_t agxbuf::capacity |
Definition at line 59 of file agxbuf.h.
Referenced by agxbmore(), and agxbsizeof().
unsigned char agxbuf::located |
Definition at line 62 of file agxbuf.h.
Referenced by agxbclear(), agxbfree(), agxblen(), agxbmore(), agxbpop(), agxbput_n(), agxbputc(), agxbuf_is_inline(), agxbuf_trim_zeros(), and vagxbprint().
struct { ... } agxbuf::s |
Referenced by agxbclear(), agxbdisown(), agxbfree(), agxblen(), agxbmore(), agxbnext(), agxbpop(), agxbput_n(), agxbputc(), agxbsizeof(), agxbstart(), agxbuf_is_inline(), agxbuf_trim_zeros(), colorxlate(), and vagxbprint().
size_t agxbuf::size |
Definition at line 58 of file agxbuf.h.
Referenced by agxbclear(), agxblen(), agxbmore(), agxbpop(), agxbput_n(), agxbputc(), agxbuf_trim_zeros(), findPath(), gvplugin_list(), and vagxbprint().
char agxbuf::store[sizeof(char *)+sizeof(size_t) *3 - 1] |
inline storage used when located
is < AGXBUF_ON_HEAP
Definition at line 64 of file agxbuf.h.
Referenced by agxbdisown(), agxbmore(), agxbnext(), agxbpop(), agxbput_n(), agxbputc(), agxbsizeof(), agxbstart(), agxbuf_is_inline(), agxbuse(), and vagxbprint().
union { ... } agxbuf::u |
Referenced by agxbclear(), agxbdisown(), agxbfree(), agxblen(), agxbmore(), agxbnext(), agxbpop(), agxbput_n(), agxbputc(), agxbsizeof(), agxbstart(), agxbuf_is_inline(), agxbuf_trim_zeros(), agxbuse(), colorx(), pov_color_as_str(), and vagxbprint().