From 8dd440a58208a9c06837a585554857072b34224f Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Sun, 13 Mar 2022 22:48:08 +0100 Subject: [PATCH] Add note about the string_t format --- m-string.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/m-string.h b/m-string.h index 6d650c8d..cfcaa906 100644 --- a/m-string.h +++ b/m-string.h @@ -99,6 +99,10 @@ typedef enum string_fgets_e { but it should be enough for most of "small" strings as most of the strings are less than 14 characters. Moreover it generates quite efficient code. + NOTE: We set the pointer to NULL (instead of storing a pointer to + the stack buffer for example) for stack based allocation so that + the string structure remains trivially movable (which is an important + property to have). */ static inline bool m_str1ng_stack_p(const string_t s)