GNUnet 0.22.1
StringBuffer Struct Reference

String container for faster string operations. More...

Data Fields

char * sbuf
 Buffer holding the string (may start in the middle!); NOT 0-terminated! More...
 
char * abuf
 Allocated buffer. More...
 
size_t slen
 Length of the string in the buffer. More...
 
unsigned int blen
 Number of bytes allocated for sbuf. More...
 
int16_t null_flag
 Buffer currently represents "NULL" (not the empty string!) More...
 
int16_t synced
 If this entry is part of the last/current generation array, this flag is GNUNET_YES if the last and current generation are identical (and thus copying is unnecessary if the value didn't change). More...
 

Detailed Description

String container for faster string operations.

Definition at line 549 of file regex_internal.c.

Field Documentation

◆ sbuf

◆ abuf

char* StringBuffer::abuf

Allocated buffer.

Definition at line 560 of file regex_internal.c.

Referenced by automaton_create_proofs_simplify(), sb_free(), sb_init(), sb_strdup(), and sb_strdup_cstr().

◆ slen

◆ blen

unsigned int StringBuffer::blen

Number of bytes allocated for sbuf.

Definition at line 570 of file regex_internal.c.

Referenced by sb_free(), sb_init(), sb_strdup(), and sb_strdup_cstr().

◆ null_flag

int16_t StringBuffer::null_flag

◆ synced

int16_t StringBuffer::synced

If this entry is part of the last/current generation array, this flag is GNUNET_YES if the last and current generation are identical (and thus copying is unnecessary if the value didn't change).

This is used in an optimization that improves performance by about 1% — if we use int16_t here. With just "int" for both flags, performance drops (on my system) significantly, most likely due to increased cache misses.

Definition at line 586 of file regex_internal.c.

Referenced by automaton_create_proofs_simplify().


The documentation for this struct was generated from the following file: