Data Fields

es_str_t Struct Reference

#include <libestr.h>

Data Fields

es_size_t lenStr
es_size_t lenBuf

Detailed Description

The string object.

We do not use es_size_t, because that tends to be 64 bits on 64 bit platforms. In almost all cases I can think of, 4GB is a sufficient upper limit on string size. So we use unsigned ints, which means we save a lot of space and efficieny, what is especially important if there is a large number of strings inside a process. For the same reason, we do not provide a way to create and automatically free a traditional C string. That would requre another pointer (8 bytes of overhead on a 64 bit machine!).

Field Documentation

es_size_t lenBuf

length of buffer (including free space)

es_size_t lenStr

actual length of string, MUST be first element of struct because of inline functions!

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