From 5d4fa31083f0bbbab87803560338af33ca6bd958 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Sun, 21 Mar 2021 00:11:58 +0100 Subject: [PATCH] Update doc & comments --- README.md | 4 ++-- m-genint.h | 6 +++--- m-string.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 0e951d33..a74ab2f2 100644 --- a/README.md +++ b/README.md @@ -5334,14 +5334,14 @@ false otherwise. ##### void string\_next (string\_it\_t it) Move the iterator to the next UTF8 encoded character. -It is assumed that string\_end\_p has been called at least once +string\_end\_p shall have been called at least once per UTF8 character before. ##### string\_unicode\_t string\_get\_cref (const string\_it\_t it) Return the unicode character associated to the UTF8 encoded character pointer by the iterator. -It is assumed that string\_end\_p has been called at least once +string\_end\_p shall have been called at least once per UTF8 character before. It returns -1 in case of error in decoding the UTF8 string. diff --git a/m-genint.h b/m-genint.h index 9e2595f0..bf1be0b3 100644 --- a/m-genint.h +++ b/m-genint.h @@ -30,7 +30,7 @@ M_BEGIN_PROTECTED_CODE -/* GENINT is a container providing unique integers. +/* GENINT is an internal container providing unique integers. It has the following properties: - it stores integer from [0..N) (N is fixed). - an integer can have only one occurrence in the container. @@ -39,7 +39,7 @@ M_BEGIN_PROTECTED_CODE - there are no order (like FIFO or stack) This can be used to map integers to index of resources in a table. - At most we can support N = 2048 with the master limb usage. + At most we can support N = 32*64 = 2048 with the master limb usage. For the typical usage of this container (mapping hardware or software limited resources), this should be enough. @@ -60,7 +60,7 @@ typedef struct genint_s { atomic_ullong *data; // the bitfield which informs if an integer is used or not } genint_t[1]; -// Define the max absolute supported value +// Define the max absolute supported value. It should be 2048 on most implementations. #define GENINT_MAX_ALLOC (M_GEN1NT_LIMBSIZE * (M_GEN1NT_LIMBSIZE - M_GEN1NT_ABA_CPT)) // Define the size of a limb in bits. diff --git a/m-string.h b/m-string.h index f40abc03..3c977c22 100644 --- a/m-string.h +++ b/m-string.h @@ -776,7 +776,7 @@ m_str1ng_replace_all_str_1ge2 (string_t v, const char str1[], size_t str1len, co M_STR1NG_CONTRACT (v); M_ASSERT(str1len >= str2len); - /* str1len < str2len so the string doesn't need to be resized */ + /* str1len >= str2len so the string doesn't need to be resized */ size_t vlen = string_size(v); char *org = m_str1ng_get_cstr(v); char *src = org;