Commit Graph
100 Commits
Author SHA1 Message Date
Patrick Pelissier 1e00a102e8 TUPLE: Defined HASH/CMP/EQUAL methods if at least ONE methods is defined in the fields. Fields that don't have or have disabled method are supposed to be secondary fields that are not pertinent for comparing the objects. 2021-09-23 23:03:30 +02:00
Patrick Pelissier 61f8dcdbae Add string_set_char function 2021-09-22 23:07:35 +02:00
Patrick Pelissier 39eeb3aec7 Fix buffer overflow in ARRAY _pop_at function (reported by tyrone718) 2021-09-18 09:52:33 +02:00
Patrick Pelissier 2178dcfcab Add LIST_INIT_VALUE & LIST_DUAL_PUSH_INIT_VALUE. 2021-08-15 21:55:09 +02:00
Patrick Pelissier f8b4f44105 Add ARRAY_INIT_VALUE 2021-08-15 21:44:36 +02:00
Patrick Pelissier 9c2468c2b7 Update comments. 2021-08-15 21:27:54 +02:00
Patrick Pelissier 3d5cc55d0a Adding assembly generation for mserial-json
in order to check proper & full inlining.
2021-08-09 10:30:53 +02:00
Patrick Pelissier 5b9cccd2dd Adding more macros not to be expanded in coverage mode 2021-08-09 10:30:04 +02:00
Patrick Pelissier 103b2ab79b Fix C++ 32 bits error on Ubuntu. 2021-08-07 17:15:45 +02:00
Patrick Pelissier 05f1cd784c Add support of GCC Static Analyzer
It seems to report only false positive.
2021-08-07 17:07:38 +02:00
Patrick Pelissier 6e6754f84e Activate tests for C++ 32 bits. 2021-08-07 10:28:19 +02:00
Patrick Pelissier 33ef448a86 Update documentation. 2021-08-07 10:27:56 +02:00
Patrick Pelissier 8ce59c2e9d Maintenance:
* update comments
* simplify code.
2021-08-07 00:34:18 +02:00
Patrick Pelissier 85a363d325 Update definition of returned iterator of _it_from of RB tree
from the greatest element of 'rbtree' lower of equal than 'data'
to the lowest element of the tree 'rbtree' greater or equal than 'data'

It is more logical and natural:
if you have a tree of elements between [2, 4], and you want
to iterate all elements from 0 to 10, the old definition doesn't allow
you to iterate easily over this subset.
2021-07-16 22:46:44 +02:00
Patrick Pelissier 7dc1a9dc0e Update RB Tree:
* Fix issue of the searched element is the root node (See #93)
for _it_from. It now returns a proper iterator.

* Update _it_from to match the last documentation:
if there is no element lower or equal to the searched node,
it returns a null iterator.

* Update _it_while_p so that it returns false if it is null iterator.
2021-07-16 21:47:37 +02:00
Patrick Pelissier 983d90b731 * Complete tests on iterators to be more exhaustive.
* Add tests on _it_from/_it_until_p/_it_while_p.
2021-07-16 21:46:57 +02:00
Patrick Pelissier f307762801 Update document of _it_from, _it_until_p, _it_while_p:
* _it_from: if there is no element that matches the condition,
it returns a null iterator, which is more coherent.
* _it_until_p: clarify condition if the iterator is null.
* _it_while_p: clarify condition if the iterator is null.
2021-07-16 21:42:55 +02:00
Patrick Pelissier 7924798e7a Update names of contract macros as per macro renaming 2021-07-16 21:41:59 +02:00
Patrick Pelissier e46bbaffb9 Avoid GCC warning (-Wstringop-truncation) 2021-07-05 23:14:21 +02:00
Patrick Pelissier 0171c49413 Unlikely some if conditions. 2021-07-05 22:45:57 +02:00
Patrick Pelissier a79cd9da97 Fix issue for RB Tree _it_equal_p method
if both iterators are equal and are associated
to a RB tree without any element.
2021-07-05 22:44:58 +02:00
Patrick Pelissier 408959c927 Be more precise in the bound check. 2021-07-05 22:32:19 +02:00
Patrick Pelissier ac4d93fe29 Clean RB Tree _pop_at to avoid an aliasing issue. 2021-07-05 20:21:26 +02:00
Patrick Pelissier 82d224fa66 Clean up documentation 2021-07-05 20:19:00 +02:00
Patrick Pelissier a5b6d8e391 Rewrite assertion to be more robust. 2021-07-04 00:20:10 +02:00
Patrick Pelissier 7f79abec3f Fix issue with INIT_WITH of array/list/....
combined with tuple:
_push_back_raw was used within an expanded macro
and as a consequence was expanded multiple times,
resulting in adding a new term in the sequence
for each field of the tuple.
2021-07-04 00:01:00 +02:00
Patrick Pelissier ca8d4aa97a Update _back & _front to return a modifiable ptr
(There is no real reasons to return a const pointer).
2021-07-03 23:59:19 +02:00
PpHd 690cef561c Merge pull request #92 from P-p-H-d/let-recur
Recursive INIT_WITH within M_LET
2021-07-01 22:33:34 +02:00
Patrick Pelissier 16ac4c556b Update documentation. 2021-07-01 22:14:17 +02:00
Patrick Pelissier 3c175b9199 Update documentation. 2021-07-01 22:12:15 +02:00
Patrick Pelissier a3827cc384 Add tests for new constructs
allowed in M_LET for tuples
2021-07-01 22:12:15 +02:00
Patrick Pelissier 353daecbd1 Comment new code. 2021-07-01 22:12:15 +02:00
Patrick Pelissier 368392fb8f Add CLEAN operator for default oplist
(same as INIT operator)
2021-07-01 22:12:15 +02:00
Patrick Pelissier 57441b2fc1 Add first draft of recursive
INIT_WITH macro for tuples.
2021-07-01 22:12:15 +02:00
Patrick Pelissier b225600238 Add internal functions for tuple
that are needed for future INIT_WITH support.
2021-07-01 22:12:15 +02:00
Patrick Pelissier 6b361e0d0c Add use of M_PRINT in C11 mode. 2021-07-01 22:12:15 +02:00
Patrick Pelissier 08668aa02b Add a new example of the new M_LET feature. 2021-07-01 22:12:15 +02:00
Patrick Pelissier 3d3eb6f1d2 Update tests to new syntax of M_LET. 2021-07-01 22:12:15 +02:00
Patrick Pelissier 9bd820c652 Force use of INIT_WITH for function object. 2021-07-01 22:12:15 +02:00
Patrick Pelissier 0e960ec23f Force use of INIT_WITH within M_LET. 2021-07-01 22:12:15 +02:00
Patrick Pelissier ca65d81b60 * Fix conflict between M_MAP2 /M_MAP2B
(this arises through M_LET & M_GET_METHOD)

* Rename M_GET_OPPROPERTY into M_GET_PROPERTY

* M_LET can be configured to always use INIT_WITH for special kind of objects.
2021-07-01 22:12:15 +02:00
Patrick Pelissier 23624a1d73 Remove M_EVAL from M_LET as it is not needed anymore. 2021-07-01 22:12:15 +02:00
Patrick Pelissier 3ac08b0395 Add test with a lot of different kind of M_LET with list of strings. 2021-07-01 22:12:15 +02:00
Patrick Pelissier dedb79dbc5 Use of new initializer macro 2021-07-01 22:12:15 +02:00
Patrick Pelissier 154b503bc6 Avoid using the input more than once in macros string_init_* (Avoid issues) 2021-07-01 22:12:15 +02:00
Patrick Pelissier 5c612ce521 Update M_LET to handle both set & init_with depending on the user syntax. Add M_INIT_WITH_VAI to use this new feature. 2021-07-01 22:12:15 +02:00
Patrick Pelissier 80582ac5ce Update as the minimum level of recursion is decreased 2021-07-01 22:12:15 +02:00
Patrick Pelissier 8e6af3bfeb Add note 2021-07-01 22:12:15 +02:00
Patrick Pelissier 61671d1b18 Minor fix 2021-07-01 22:12:15 +02:00
Patrick Pelissier aa3ad973d0 Add another recussive M_LET test 2021-07-01 22:12:15 +02:00
Patrick Pelissier a19a010d1e Add WIP version for a M_LET recursive 2021-07-01 22:12:14 +02:00
Patrick Pelissier 36003b6bb3 * Add support for extented variable for M_[F]PRINT
* Update documentation
* Add test.
2021-07-01 00:13:31 +02:00
Patrick Pelissier 3c83e4088c Add internal macro M_MERGE_ARGLIST 2021-06-20 11:06:19 +02:00
Patrick Pelissier 357feb9532 Update documentation as per lastest changes. 2021-06-19 22:47:13 +02:00
Patrick Pelissier 7e234cba65 Add test of M_FPRINT using string_t. 2021-06-19 22:46:58 +02:00
Patrick Pelissier 0535ceeaeb Add support of string_t by M_PRINT macro. 2021-06-19 22:46:41 +02:00
Patrick Pelissier e688f0b1df Add internal method M_GET_OPPROPERTY to get the subproperty of an oplist
Add test for such macro
Rename operator CLASS into PROPERTIES
2021-06-17 00:20:35 +02:00
Patrick Pelissier a950e15625 Adding method for NAME operator for basic containers 2021-06-12 11:11:30 +02:00
Patrick Pelissier cf8b198dac Fix issue in M_LET: if the INIT/INIT_SET/INIT_WITH uses the macro M_IF, it may be not expanded in some cases (since the M_CALL_* is used itself within an expanded tainted M_IF). Fix this by calling M_CALL_* outside the expanded M_IF. 2021-05-23 00:53:54 +02:00
Patrick Pelissier c75d5da02d Fix: use of M_CALL_INIT / M_CALL_CLEAR instead of M_GET_INIT / M_GET_CLEAR so that API transformation can be applied 2021-05-23 00:42:43 +02:00
Patrick Pelissier cdffb15066 Simplify code 2021-05-23 00:34:08 +02:00
Patrick Pelissier cd0ad0dba9 Factorize code 2021-05-23 00:31:23 +02:00
Patrick Pelissier d3be5dba96 Reduce number of created threads, as sometimes it hits the limits 2021-05-22 18:11:09 +02:00
Patrick Pelissier cb94a26a9f Update documentation 2021-05-22 17:33:46 +02:00
Patrick Pelissier 3c8b238e75 Add operator CLASS and new keywords 2021-05-22 17:33:34 +02:00
Patrick Pelissier 74202d52b3 Adding default value for LIMITS
enabling to avoid defining then for all types.
2021-04-16 23:23:42 +02:00
Patrick Pelissier 603c92cd0e Cleanup uneeded final comma separator 2021-04-10 23:27:49 +02:00
Patrick Pelissier e514d74f43 Update test to be more pertinent 2021-04-04 22:28:32 +02:00
Patrick Pelissier 970161464a Add constraint 2021-04-04 22:28:13 +02:00
Patrick Pelissier 3e7de27c00 Rename M_HASH_SEED into M_USE_HASH_SEED
as it a user overridable macro
(API break).
2021-04-03 23:15:12 +02:00
Patrick Pelissier e28d403216 Undo previous changes until further analysis (it broke CI) 2021-03-28 11:53:18 +02:00
Patrick Pelissier fdeb9f1322 Format 2021-03-28 11:48:59 +02:00
Patrick Pelissier 76fad21103 Update comments and naming 2021-03-28 11:48:59 +02:00
Patrick Pelissier 5d4fa31083 Update doc & comments 2021-03-28 11:48:58 +02:00
Patrick Pelissier c3858f4e63 Update documentation 2021-03-28 11:48:58 +02:00
Patrick Pelissier 2e0fc21878 Fix _push_move of SPSC. It shall take a pointer to the object, not the object itself as argument, just like the other _push_move 2021-03-28 11:48:58 +02:00
Patrick Pelissier 4b71bbec7e Protect key from being changed while iterating. 2021-03-28 11:13:55 +02:00
Patrick Pelissier 052989a5a2 Update m_serial_ll_ct to have more basic types. 2021-03-28 11:09:59 +02:00
Patrick Pelissier 60cfc63c4e Add static assertion. 2021-03-28 09:39:52 +02:00
Patrick Pelissier 60ef4c7f06 Fix documentation 2021-03-28 09:39:41 +02:00
Patrick Pelissier 58fc40d0f1 Update oplist 2021-03-28 09:32:23 +02:00
Patrick Pelissier 3d7e9e7c03 Add _get_at method for B+TREE 2021-03-28 09:29:04 +02:00
Patrick Pelissier 52e745f905 Update documentation of operators 2021-03-27 21:15:03 +01:00
Patrick Pelissier 8433fc178c Fix issue for union with visual & clang-cl 2021-03-20 13:16:10 +01:00
Patrick Pelissier 59807baa18 Fix several minor issues on m-buffer:
1) Fix performance issue if the buffer was not designed
to be thread safe. The internal numbers are in this cases
just plain numbers and not atomic numbers. This is done
through union. Fix #90

2) In case of thread safe buffer, put each item in a
separate cacheline. This ensures proper performance in
case there is several producers. This however
increases the consumption size.

3) Fix a data race issue: after the mutex is locked,
and before the test if the buffer is empty (through the
atomic read of its size). It is solved by performing a
memory acquire when testing if the buffer is empty.

4) Add more comments.
2021-03-20 13:01:51 +01:00
Patrick Pelissier 9b5b15e8cb Update comment 2021-03-16 21:43:09 +01:00
Patrick Pelissier 2c54b63c51 Update dev doc 2021-03-16 21:42:48 +01:00
Patrick Pelissier e4d1167274 Improve test suite to be more representative 2021-03-14 23:42:05 +01:00
Patrick Pelissier 2f10aba390 Workaround issue with address sanitizer 2021-03-14 21:26:04 +01:00
Patrick Pelissier a044fadec8 Fix minor warning in some compiler options 2021-03-14 11:00:05 +01:00
Patrick Pelissier 0edb6165b5 Fix buffer overflow if size=64*N 2021-03-13 23:39:26 +01:00
Patrick Pelissier 7d262f2450 Fix formatting 2021-03-13 23:08:04 +01:00
Patrick Pelissier fa30328572 Reduce allowed range for buffer to unsigned int. It should be more than enough for any scenario. 2021-03-13 22:43:01 +01:00
Patrick Pelissier b0cff7c6ac Remove git checkout HEAD^2 as per recommendation of CodeQL 2021-03-09 22:39:02 +01:00
Patrick Pelissier 50da9e803c Add documentation for m_serial_str_json 2021-03-09 22:12:44 +01:00
Patrick Pelissier 26252fedf5 Add test for JSON serialization over string 2021-03-09 22:12:29 +01:00
Patrick Pelissier 2dcda90c7b Add JSON serial over string 2021-03-09 22:12:16 +01:00
Patrick Pelissier b7d79c0a83 Fix issue for wrong formatted JSON (error not properly reported) 2021-03-09 20:56:13 +01:00
Patrick Pelissier ae285c0a01 Add also const string in serial object 2021-03-09 20:55:46 +01:00
Patrick Pelissier 07db846f3b Rename internal string functions to be compliant with new scheme. Not sure if this scheme will remain however (still searching for a better naming that fits all criteria). 2021-03-01 22:18:32 +01:00