diff -r 25ead2ffb9b5 -r 0499bf03aef3 src/cx/buffer.h --- a/src/cx/buffer.h Thu Dec 11 17:08:17 2025 +0100 +++ b/src/cx/buffer.h Thu Dec 11 22:43:13 2025 +0100 @@ -89,6 +89,13 @@ #define CX_BUFFER_COPY_ON_EXTEND 0x08 /** + * If this flag is enabled, the buffer will never free its contents regardless of #CX_BUFFER_FREE_CONTENTS. + * + * This is useful, for example, when you want to keep a pointer to the data after destroying the buffer. + */ +#define CX_BUFFER_DO_NOT_FREE 0x10 + +/** * Function pointer for cxBufferWrite that is compatible with cx_write_func. * @see cx_write_func */