Commit Graph
100 Commits
Author SHA1 Message Date
Patrick Pelissier 97ff413f01 Maintenance:
Separate big macros into several smaller ones
2023-01-22 23:33:13 +01:00
Patrick Pelissier 8e4ac99a35 Separate macro into smaller macros (more maintenable) 2023-01-20 23:45:40 +01:00
Patrick Pelissier 4366e8eeab Separate macro into smaller macros
to ease reading and enable easier customization of generation
2023-01-20 23:45:40 +01:00
Patrick Pelissier 4e5e498bb2 Add new library 2023-01-09 23:35:33 +01:00
Patrick Pelissier 870a6f4b57 Update to 0.7.1 2023-01-02 13:06:29 +01:00
Patrick Pelissier a2ae209992 Happy new year 2023-01-02 12:57:41 +01:00
Patrick Pelissier 43fdd10e77 Release 0.7.0 2022-12-27 20:01:44 +01:00
Patrick Pelissier b1183de0f8 Update example to allow more example of promotion. 2022-12-25 23:12:02 +01:00
Patrick Pelissier 3a3ef7454c Fix conflict issue between INIT_WITH_VAI macro and API transformation.
Since both used M_MAP2_C macro, the final expansion was stopped if an
API generic transformation was requested in INIT_WITH_VAI.
Duplicate M_MAP2_C internally for API transformation.
2022-12-24 23:04:42 +01:00
Patrick Pelissier 5f946b728b Update example to include more integration of the different features
(enabling to test more).
2022-12-24 23:03:48 +01:00
Patrick Pelissier 9cc03ff81b Add macro M_INIT_WITH_THROUGH_EMPLACE_TYPE that provides an INIT_WITH
method that scans the different methods provided in EMPLACE_TYPE and
try to search for a matching one.
2022-12-23 11:49:08 +01:00
Patrick Pelissier 89d4db174e Fix format 2022-12-23 11:48:15 +01:00
Patrick Pelissier f5bbc0a7fb Implement multiple kind of workarounds for GCC 12
as it produces more false warnings

Include missing header in C++ mode
2022-12-22 20:42:20 +01:00
Patrick Pelissier 9da0d1d94b Add new internal macro M_TAIL_3 2022-12-22 15:49:10 +01:00
Patrick Pelissier fafaaafdbf Avoid warning for M_RET_ARG if there is the exact number of argument.
Add internal M_TRIPLE_* macros (TBC)
2022-12-22 14:05:46 +01:00
Patrick Pelissier 38f4107b19 Support of keyptr /valueptr iterator 2022-12-04 23:39:42 +01:00
Patrick Pelissier cbefdab4bb Add check of B+TREE map against C++ map 2022-12-04 21:26:20 +01:00
Patrick Pelissier bcd0c46e8b Simplify & factorize the instances of the check against C++ 2022-11-30 23:56:29 +01:00
Patrick Pelissier f25bb73e58 Add comparison to C++ unorder_map 2022-11-30 00:30:45 +01:00
Patrick Pelissier ea3584e048 Rename internal macro to internal namespace 2022-11-29 23:16:55 +01:00
Patrick Pelissier 85473610a4 Update doc 2022-11-22 22:51:40 +01:00
Patrick Pelissier f9f0b307fc Provide even shorter example using EMPLACE_TYPE 2022-11-10 13:50:00 +01:00
Patrick Pelissier d17fa4530b Update comments 2022-11-05 13:36:57 +01:00
Patrick Pelissier 3806495e2d Fix spelling 2022-11-04 10:41:38 +01:00
Patrick Pelissier 15f58d5738 Update example comments. 2022-10-23 21:01:44 +02:00
Patrick Pelissier 4de7da1c05 Adding bench for emhash
https://github.com/ktprime/emhash
2022-10-15 10:24:18 +02:00
Patrick Pelissier 93229c61f2 Update comments 2022-10-12 23:26:33 +02:00
Patrick Pelissier 3f0e8956b8 Add emplace method for buffer. 2022-10-11 22:47:14 +02:00
Patrick Pelissier b82670b643 Add emplace support for concurrent. 2022-10-10 23:08:30 +02:00
Patrick Pelissier 64800dbd3f Use of type from oplist rather than meta name
(more coherent)
2022-10-10 23:06:02 +02:00
Patrick Pelissier 2d9d9fbd9f Remove obsolete macros 2022-10-10 22:54:48 +02:00
Patrick Pelissier f0ba5d17f4 Rework fuzzer support to be fully generic. 2022-10-10 22:47:43 +02:00
Patrick Pelissier e51c988222 Add initial support for fuzzing 2022-10-07 23:39:54 +02:00
Patrick Pelissier 0be3900beb Enable support for external testsuite from stdin
instead of pseudo random values.
This will enable to connect it to a fuzzer.
2022-10-07 23:28:12 +02:00
Patrick Pelissier f60ce0320a Port to new API version of STC. 2022-10-07 22:47:53 +02:00
Patrick Pelissier 77008b8622 Fix leak of memory in non optimized _safe_get
of B+Tree.
2022-10-03 23:07:13 +02:00
Patrick Pelissier a7617002c5 Update documentation for emplace generation. 2022-10-03 22:54:42 +02:00
Patrick Pelissier bc73616bde Add test cases for emplace generation
for dict & B+tree
2022-10-03 22:40:44 +02:00
Patrick Pelissier d6b9b054c2 Fix emplace generation
(incorrect value oplist)
2022-10-03 22:34:13 +02:00
Patrick Pelissier 9eed4be97c Add emplace support for B+Tree 2022-10-03 22:16:50 +02:00
Patrick Pelissier 2519927178 Fix build in case of no MPFR and warnings are treated as errors. 2022-10-02 22:31:50 +02:00
Patrick Pelissier 0fec33b38e * Add emplace generation for dict/hashmap.
(still need more tests).
* Factorize emplace generation for R+TREE/Prioqueue
2022-10-02 22:24:22 +02:00
Patrick Pelissier dc2b6d2b2d Fix detection of GMP / MPFR. 2022-10-02 22:16:45 +02:00
Patrick Pelissier bc63edc595 Fix emplace generation for asso array 2022-10-02 21:41:21 +02:00
Patrick Pelissier 6241a3093c Factor comments. 2022-10-02 21:35:52 +02:00
Patrick Pelissier fb53a464d7 Update comments 2022-10-01 20:41:45 +02:00
Patrick Pelissier aba26b75a2 Fix chapter in documentation 2022-10-01 11:40:23 +02:00
Patrick Pelissier 775ec6f91b Make M_ASSERT_INDEX more robust
in case it is called with a signed integer.
The trick was using x-x to represent 0 so that
the compiler won't complain with the comparaison
x >= 0 when it is called with unsigned number.
2022-10-01 11:38:11 +02:00
Patrick Pelissier 95bc7063a0 Remove some warning with clang:
it complains about using a GNU extension
in GNU mode (gnu11)!
2022-10-01 11:36:14 +02:00
Patrick Pelissier 731d3ecf1a Update error chapter of the documentation 2022-10-01 09:50:38 +02:00
Patrick Pelissier 0d1817e7ca Add tiny example of no stdio support. 2022-10-01 09:50:24 +02:00
Patrick Pelissier 1a5b428bfb Fix proper support of no stdio
and add macro M_RAISE_FATAL to raise a fatal error
with the default is using stdio.
2022-10-01 09:50:09 +02:00
Patrick Pelissier bd49e31f3b Add definition macros for emplace/associative array container. 2022-09-29 23:48:46 +02:00
Patrick Pelissier 2dba83e3c5 Remove M_USE_STDLIB
(It wasn't working at all).
2022-09-28 22:16:04 +02:00
Patrick Pelissier 75e9766da9 Fix wrong generation for emplace / value 2022-09-26 23:43:39 +02:00
Patrick Pelissier d2f8aa1c0d Update documentation. 2022-09-25 22:15:44 +02:00
Patrick Pelissier 4aa4b7693f Add M_C5_EMPTY macro
Add M_CROSS_MAP2 macro
Add emplace generation  for associative array if both key & value are emplace types
Add test cases.
2022-09-25 22:13:51 +02:00
Patrick Pelissier d50b450927 Update documentation. 2022-09-25 00:36:27 +02:00
Patrick Pelissier 5674cdbfc5 Add new macro M_CROSS_MAP
enabling to map a function to each pair
of arguments given two arglists.
2022-09-25 00:30:23 +02:00
Patrick Pelissier 3641829198 M_INC (resp. M_DEC) of M_UNDERFLOW (resp. M_OVERFLOW)
will keep the initial error.
2022-09-16 18:46:13 +02:00
Patrick Pelissier 10a759b09e Add another function for generation 2022-09-15 23:25:42 +02:00
Patrick Pelissier b5a3b36c1b * Add M_C3_EMPTY function.
* Add WIP generator for emplace functions for associative array. What is missing is the hard part (even what is done cannot be said as easy!) Generation of both N x M functions. It probably needs a new MAP function for this.
2022-09-15 23:25:38 +02:00
Patrick Pelissier b0c3839f2b Add serial methods in documentation. 2022-09-15 21:39:17 +02:00
Patrick Pelissier 3aa3e95e4c Remove constraint of calling string_end_p
before string_next or string_get_cref
This generates slighty more code but it is much saner
from user point of view.
2022-09-13 00:18:15 +02:00
Patrick Pelissier 87f1e53e13 Add more basic iteration code generation analysis 2022-09-13 00:03:40 +02:00
Patrick Pelissier d7b45cc220 Fix issue in string_previous 2022-09-11 23:14:52 +02:00
Patrick Pelissier d8142a9764 Add precision on documentation. 2022-09-10 16:38:27 +02:00
Patrick Pelissier 8780f58739 Fix description of string_unocde_t 2022-09-10 16:35:38 +02:00
Patrick Pelissier e352104df8 Update documentation with new function. 2022-09-10 16:30:57 +02:00
Patrick Pelissier cbb2b452bb Add string_previous function
to iterate on the previous UTF8 code point.
2022-09-10 16:30:45 +02:00
Patrick Pelissier 6e947c6262 Add more corner cases. 2022-09-10 16:21:19 +02:00
Patrick Pelissier 18f04da4ec Robustness/fix:
string_next won't advance if the end of string is reached.
2022-09-10 16:19:58 +02:00
Patrick Pelissier 3dad6ef65c Update string API description. 2022-09-10 16:16:42 +02:00
Patrick Pelissier 41c4f5fe5c Add string functions :
* string_it_get_pos to return the position in the steam
* string_it_pos to start iterating from a given position.
2022-09-10 16:16:13 +02:00
Patrick Pelissier cfeedf19f8 Rework to be more compliant (as far as it is possible)
to real cases.
2022-09-10 15:56:36 +02:00
Patrick Pelissier 2ab410bd6a Update comments to reflect that we work
on UTF8 code points and not Unicode characters.
2022-09-10 10:39:04 +02:00
Patrick Pelissier aefbc5b2f5 Factorize the test of the start of an UTF8 code point
in a separate function
2022-09-10 10:34:54 +02:00
Patrick Pelissier abec9c37fa Clarify API
It iterates over UTF-8 code points, not Unicode characters
They can be different (!)
2022-09-10 10:32:34 +02:00
Patrick Pelissier 442b0e7cea Reduce size of struct string_it_t on 64 bits
by storing an offset to the next character
instead of a pointer. An offset can be stored as a
BYTE instead of a PTR since UT-8 can use at most
4 characters per code point.
2022-09-10 09:59:06 +02:00
Patrick Pelissier 0b853c6d52 Fix bug on bitset_resize function in case of increase of size:
the first limb may not be cleared properly in some cases.
(Reported by David M. Lary)
2022-09-04 19:27:38 +02:00
Patrick Pelissier cc7fc66899 Add bitset_ctz function 2022-08-29 19:31:19 +02:00
Patrick Pelissier 6b994c2928 Add m_core_ctz32 & m_core_ctz64 functions
(Count trailing zeros)
2022-08-29 19:30:09 +02:00
Patrick Pelissier e6fe36d3cd Revert "Perform coverage check by continuous integration tests."
as the numbers of lines generated by the generation macros
(which are included in the coverage measure)
through the C preprocessor depend on the exact version
of the C preprocessor.
There is no reliable way to get a measure on it,
except by always targeting the same compiler.
So, this measure of coverage (number of lines)
is not suitable for CIT. Ratio seems also not reliable enough.

This reverts commit f45ededf8b.
2022-08-22 23:53:10 +02:00
Patrick Pelissier f45ededf8b Perform coverage check by continuous integration tests. 2022-08-20 23:33:48 +02:00
Patrick Pelissier ed27bedcb4 Make coverage perfoms a check that the computed coverage is at least
not lower than the reference coverage, ensuring no regression
on the coverage of the tests can occur.

NOTE: some tests (m-i-shared) perform some dynamic test cases
where the exact coverage depend on the exact dynamic behavior
of the test. And this behavior is not always reproducible
(for exact the calls to m_core_backoff_wait may not occur
if the threads are not trying to grab the resource at the
exact same time).
As such, the reference of such tests is taken from the worst
case of execution of the coverage (with the lowest number
of lines covered).
2022-08-20 23:29:02 +02:00
Patrick Pelissier eb1a7a0435 Add more tests for tree 2022-08-19 23:16:42 +02:00
Patrick Pelissier de00fdc5f7 Update documentation 2022-08-13 23:50:51 +02:00
Patrick Pelissier 8febe12c5c Make stdlib an optional header 2022-08-09 00:20:32 +02:00
Patrick Pelissier 1368b201eb Fix warnings in release mode. 2022-08-09 00:19:55 +02:00
Patrick Pelissier 4ca166b0b9 Update examples to remove warnings with assertion disabled. 2022-08-09 00:19:26 +02:00
Patrick Pelissier c13533cf21 Fix naming 2022-08-08 01:22:05 +02:00
Patrick Pelissier 9fdf0f76e7 Add documentation of generic tree. 2022-08-08 01:20:30 +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 b6e0994dfc Add test case for _init_set with empty tree. 2022-08-02 23:02:33 +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 ecebd62f86 Update API compatibility documentation due to the _str to _cstr suffix change.
Note: the old (& still official) naming for the string functions
is still compatible since we have changed only the new namings (with m_ prefix).
See #99
2022-07-30 12:02:58 +02:00
Patrick Pelissier 6a8c9a703d Rename string functions as per latests changes 2022-07-30 12:02:32 +02:00