Commit Graph
55 Commits
Author SHA1 Message Date
Patrick Pelissier 26fc2bcffe Port tree to new memory model 2025-05-07 21:02:23 +02:00
Patrick Pelissier 1cf7c4fa4d Port to new memory model: M_MEMORY_FULL cannot return anymore 2025-05-07 21:02:23 +02:00
Patrick Pelissier 50e8d1f469 Fix old size parameter for memory allocation 2025-05-07 21:02:23 +02:00
Patrick Pelissier 1e196fe22a Port to new spec M_MEMORY_FULL 2025-05-07 21:02:23 +02:00
Patrick Pelissier 1f2584ccea Port to new memory model 2025-05-07 21:02:23 +02:00
Patrick Pelissier 36d11bc2bd Fix small name usage 2025-03-01 12:19:35 +01:00
Patrick Pelissier 6d621703eb Copyright go to 2025 year 2025-03-01 11:03:38 +01:00
Patrick Pelissier d22e75d7a0 Make I/O functions exception aware.
Simplify their logic
Fix other bugs.
2024-03-08 00:15:08 +01:00
Patrick Pelissier 26cec1591a * Remove some obsolete macros
* Fix spelling
* A little bit of refactoring
2024-01-19 21:37:47 +01:00
Patrick Pelissier 52b58c5a51 Happy new year 2024 2024-01-19 21:37:47 +01:00
Patrick Pelissier b50813713a Define internal M_INLINE:
it is used to control the inline semantics.
By combining it with optimize option "-fno-inline"
for the internal M*LIB function (using _Pragma optimize)
we can control easily if we want to use an inline version
or call of an external function.

Define new user API:
* M_USE_EXTERN_DECL : define it before including any MLIB header to requests to call the M*LIB functions and don't inline then.
* M_USE_EXTERN_DEF  : define it once in a translation unit to define the M*LIB functions. This translation unit shall contain all templated macro too.
If you use one option, you need to use the other one too for another translation unit.
2023-06-11 23:32:02 +02:00
Patrick Pelissier 219c62ff5d Provide a way to alter the standard naming convention for the functions
Close #72
2023-04-22 09:33:08 +02:00
Patrick Pelissier de0ef67cf2 Fix build issue with VC++ 2023-04-19 23:06:23 +02:00
Patrick Pelissier a6c1688f23 Fix issue in remove root node for tree (part 2) 2023-04-19 22:37:40 +02:00
Patrick Pelissier f6ed549ce5 Fix issue in tree_remove for root node index (Part 2)
Enable support of removing root node
In this case, it considers the first child of the root as the new root (breaking symetry)
2023-04-18 23:24:48 +02:00
Patrick Pelissier 8639fdbd98 Fix issue in tree_remove when it is root node (part 1) 2023-04-18 22:56:56 +02:00
Patrick Pelissier 4052d3794b Tree: Transform runtime tests into assertion
as it is proven that it cannot happen.
2023-04-18 22:19:28 +02:00
Patrick Pelissier b5df21f9c5 Simplify function: for LCA both iterators shall be in the same tree 2023-04-13 23:26:12 +02:00
Patrick Pelissier a8075cbb05 Transform runtime test into assertion
as it is proven that it cannot happen.
2023-04-11 21:57:56 +02:00
Patrick Pelissier 7534aa0d61 Add internal M_UNLIKELY_NOMEM to help coverage computation 2023-04-03 00:05:29 +02:00
Patrick Pelissier 2f76652f2b Maintenance 2023-03-03 22:50:14 +01:00
Patrick Pelissier 8562986eea Avoid dereferencing the table in asserts if the lock is done on the tree:
it usually means that the tree is partially accessed by other
threads (at least the derefencing methods which should be
safe).
2023-02-18 00:15:31 +01:00
Patrick Pelissier f70b52c9e4 TREE: Add support for emplace functions 2023-01-28 14:48:12 +01:00
Patrick Pelissier 40249ce5bc Separate macros into smaller more functionnal ones 2023-01-28 14:48:01 +01:00
Patrick Pelissier a2ae209992 Happy new year 2023-01-02 12:57:41 +01:00
Patrick Pelissier 1368b201eb Fix warnings in release mode. 2022-08-09 00:19:55 +02:00
Patrick Pelissier 308f513edc As the allocated array offers write access to the index -1
remove if conditions to always access the array even for -1
The term tab[-1] will be filled with no pertinent value, but
we don't care about it.
2022-08-02 23:21:39 +02:00
Patrick Pelissier 900bcc3819 The internal array of the tree always allocates one more term,
so that the index -1 in the array exists and can be written.
2022-08-02 23:02:59 +02:00
Patrick Pelissier 121339d948 Add _move_* functions for generic tree. 2022-08-01 22:17:26 +02:00
Patrick Pelissier c5bb84013a Create _raw methods for insertions. 2022-08-01 22:13:41 +02:00
Patrick Pelissier 65b49268d3 Fix allow_realloc for tree 2022-07-30 16:14:03 +02:00
Patrick Pelissier abffe201e5 Change the suffix of the functions dealing with C-String to _cstr
instead of _str.
See #99 for details.
2022-07-30 12:00:55 +02:00
Patrick Pelissier 58746560e9 Add comment 2022-07-28 23:21:54 +02:00
Patrick Pelissier ee1dc2a8e8 Fix issue in _graft_child 2022-07-27 23:48:40 +02:00
Patrick Pelissier 399c615915 Fix issue in unlink 2022-07-26 23:04:15 +02:00
Patrick Pelissier 90c54a48d0 Remove uneeded test 2022-07-26 22:48:47 +02:00
Patrick Pelissier dab085e3a7 Fix other issue 2022-07-24 21:11:08 +02:00
Patrick Pelissier 66fac10a98 Fix corner case 2022-07-24 21:09:35 +02:00
Patrick Pelissier e5fb5ddde1 Fix some issues in insertion 2022-07-24 20:40:31 +02:00
Patrick Pelissier 5d659877fe Fix some bugs in the swap of node in a tree 2022-07-24 00:47:43 +02:00
Patrick Pelissier b1f698bb7b Fix tree _prune function 2022-07-18 23:42:13 +02:00
Patrick Pelissier 7e120a3615 Add missing assertions 2022-07-15 16:54:51 +02:00
Patrick Pelissier 8f3c0af548 Add OUT_STR & IN_STR methods for tree 2022-07-07 22:21:14 +02:00
Patrick Pelissier 12608afe10 Fix issue in comparing tree 2022-07-05 22:46:13 +02:00
Patrick Pelissier e64a6a22e7 Fix issues in tree 2022-06-28 23:28:09 +02:00
Patrick Pelissier 76892afa13 Fix some warnings. 2022-06-27 23:35:05 +02:00
Patrick Pelissier dcb1eb0d94 First version of IO for the tree container 2022-06-25 17:29:04 +02:00
Patrick Pelissier 950ea224ff Adding untested classic functions for tree (_init_set, _set, _equal, _hash, ...) 2022-06-18 15:26:19 +02:00
Patrick Pelissier 5b7be93c1a Update tree:
* fix swap and add an additional argument to swap or not the child
* add sort functions for the children of a nodes
2022-06-13 23:21:06 +02:00
Patrick Pelissier bfffa1d245 Update comments & naming 2022-06-04 16:02:58 +02:00