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
6d621703eb
Copyright go to 2025 year
2025-03-01 11:03:38 +01:00
Patrick Pelissier
5b77fe7207
Add some missing const in the interface
2024-11-30 10:25:36 +01:00
Patrick Pelissier
eeaf74d24f
Add FULL_P operator
...
Add M_EMPLACE_LIST_TYPE_VAR_ALTER which doesn't put a comma before.
2024-10-26 16:56:54 +02: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
422f3c2c04
Add GENTYPE operator to all oplists
2023-12-30 16:23:02 +01:00
Patrick Pelissier
e9b25f2414
Rename internal field size to capacity
...
to match what it is used for.
2023-07-13 21:48:33 +02: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
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
91f3174a36
Rename m-mutex header into m-thread
...
as it is not just about mutex but about thread functions
just like the header pthread or thread.h
2023-02-16 00:09:06 +01:00
Patrick Pelissier
e9ca506d93
Factorization of macros
2023-02-03 20:53:27 +01:00
Patrick Pelissier
a2ae209992
Happy new year
2023-01-02 12:57:41 +01:00
Patrick Pelissier
3f0e8956b8
Add emplace method for buffer.
2022-10-11 22:47:14 +02:00
Patrick Pelissier
5a1f768b03
Update comment about lock-free property
2022-05-14 09:16:41 +02:00
Patrick Pelissier
95b104ee48
Issue in generation of functions:
...
if the method in the oplist uses API_* transformation,
if this method is a macro itself,
it may delay the expansion too much and
the macro may not be expanded at all in the final code generation.
Fix issue by adding a supplementary evaluation in the macro expansion.
Add test cases
2022-05-06 01:10:31 +02:00
Patrick Pelissier
e1abf0528c
Rename M_DEFAULT_OPLIST in M_BASIC_OPLIST (cleaner name)
2022-04-08 22:54:29 +02:00
Patrick Pelissier
b8cd679679
Move generating macro into the m_ namespace and create a wrapper using historical names for compatibility with existing code
2022-03-24 20:46:49 +01:00
Patrick Pelissier
19b01b404d
Migrate to 2022
2022-03-12 20:25:45 +01:00
Patrick Pelissier
6b064870f5
Rename CLEAN operator in RESET operator
2021-10-30 23:26:27 +02:00
Patrick Pelissier
836d892832
Rename BUFFER, I-LIST, PRIOQUEUE & SHARED _clean in _reset to avoid confusing _clean & _clear functions. See #97
2021-10-28 18:08:07 +02:00
Patrick Pelissier
a950e15625
Adding method for NAME operator for basic containers
2021-06-12 11:11:30 +02:00
Patrick Pelissier
76fad21103
Update comments and naming
2021-03-28 11:48:59 +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
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
e25e9ba29b
Make the contract of Array & Buffer fail after a clear.
2021-02-21 21:08:35 +01:00
Patrick Pelissier
517da1b999
Rename generated internal functions
...
to avoid "poluting" userspace naming.
2021-02-13 11:45:05 +01:00
Patrick Pelissier
25497bd96f
Factorize code so that _DEF macros use _DEF_AS ones
2021-02-07 23:04:59 +01:00
Patrick Pelissier
25fe26deaa
Happy new year
2021-01-13 20:18:01 +01:00
Patrick Pelissier
1b4c608087
Rename operator TEST_EMPTY into EMPTY_P to be compliant with iterator operator
2021-01-07 22:13:10 +01:00
Patrick Pelissier
a29682ca29
Create M_ASSERT macro to encapsulate assert within M*LIB
...
The goal is to enable the user to override this macro if needed so that it can enable or disable the M*LIB witout impacting its own assertions.
2020-10-29 22:46:17 +01:00
Patrick Pelissier
54d4b80368
Reformat macro to 80 characters
2020-10-21 23:23:40 +02:00
Patrick Pelissier
1d8e541205
Add macros BUFFER_DEF_AS, QUEUE_MPMC_DEF_AS, QUEUE_SPSC_DEF_AS
2020-10-03 14:07:14 +02:00
Patrick Pelissier
b396b42808
Update comments
2020-10-03 14:07:14 +02:00
Patrick Pelissier
b3a1a75f6f
Rename internal types:
...
a suffix ending with _ct means confidential type
ans is reserved for M*LIB internal usage.
OPLIST doesn't use the external types
but rather the internal types.
It enables to be independent of the real names
of the external types.
Such external names are planned to be fully customizable
(i.e. the user may define a name that suits its coding style)
2020-10-03 14:07:14 +02:00
Patrick Pelissier
5f9feb833c
Replace TAB by SPACE
2020-07-25 19:17:25 +02:00
Patrick Pelissier
8a36b5ff15
Workaround to avoid CLANG unused function warnings
2020-07-09 22:14:00 +02:00
Patrick Pelissier
cc6da8941c
* Fix wanings for reduce precision on integers.
...
* Add wrapper for strncat
2020-06-22 00:14:37 +02:00
Patrick Pelissier
f4b9185ceb
Update documentation on QUEUE_MPMC
2020-06-06 11:09:55 +02:00
Patrick Pelissier
78d0bfb286
Port new error oplist format to all containers.
2020-05-30 18:00:43 +02:00
Patrick Pelissier
d1ae26f0fd
* Add control than the type and the oplist are compatible
2020-05-17 10:27:30 +02:00
Patrick Pelissier
49a2e600c4
Add control of sub-oplist when creating a new oplist of a container
...
Add test case of this new control
Fix some corner bugs in some containers evolving their own oplists.
2020-05-15 21:19:39 +02:00
Patrick Pelissier
113fdbf388
Add more controls on proper presence of oplist for _DEF macros
2020-05-09 17:16:00 +02:00
Patrick Pelissier
4f7b0b9455
Happy new year 2020
2020-01-04 15:41:06 +01:00
Patrick Pelissier
5111b0c726
Deprecated some buffer options since the _blocking functions are much more usefull
2019-12-27 16:39:42 +01:00