From 78c3ea30a6f8f6db14cd4df146ce233398b8e0d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20Nordl=C3=B6w?= Date: Tue, 27 Dec 2022 21:50:39 +0100 Subject: [PATCH] Reduce CString memory usage from 3 to two 2 words --- tcc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tcc.h b/tcc.h index 763835ed..baae6705 100644 --- a/tcc.h +++ b/tcc.h @@ -497,9 +497,10 @@ typedef int nwchar_t; typedef struct CString { int size; /* size in bytes */ - void *data; /* either 'char *' or 'nwchar_t *' */ int size_allocated; + void *data; /* either 'char *' or 'nwchar_t *' */ } CString; +_Static_assert(sizeof(CString) == 16, "CString should only require 16 bytes"); /* type definition */ typedef struct CType {