Reduce CString memory usage from 3 to two 2 words

This commit is contained in:
Per Nordlöw 2022-12-27 21:50:39 +01:00
parent 7ed9c95ae7
commit 78c3ea30a6

3
tcc.h
View File

@ -497,9 +497,10 @@ typedef int nwchar_t;
typedef struct CString { typedef struct CString {
int size; /* size in bytes */ int size; /* size in bytes */
void *data; /* either 'char *' or 'nwchar_t *' */
int size_allocated; int size_allocated;
void *data; /* either 'char *' or 'nwchar_t *' */
} CString; } CString;
_Static_assert(sizeof(CString) == 16, "CString should only require 16 bytes");
/* type definition */ /* type definition */
typedef struct CType { typedef struct CType {