Commit Graph
22 Commits
Author SHA1 Message Date
Patrick Pelissier 1e196fe22a Port to new spec M_MEMORY_FULL 2025-05-07 21:02:23 +02:00
Patrick Pelissier 68fdc2dde1 Fix undefined behavior in using setjmp 2025-03-06 15:38:44 +01:00
Patrick Pelissier 6d621703eb Copyright go to 2025 year 2025-03-01 11:03:38 +01:00
Patrick Pelissier 32cfbd23bc Update comments. 2024-11-02 16:59:40 +01:00
Patrick Pelissier bc8098b337 Update comments. 2024-10-30 23:31:47 +01:00
Patrick Pelissier 8f97a194ae Add m_volatile 2024-04-08 23:08:16 +02:00
Patrick Pelissier 12ee3213b0 Simplify M_ON_EXCEPTION / M_IF_EXCEPTION 2024-04-06 19:13:08 +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 469239adcd Update comments 2023-08-24 23:32:47 +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 b44e4e09dd Don't use builtin for clang as they are not properly supported. 2023-04-16 20:11:56 +02:00
Patrick Pelissier 5158059ec4 Make m_throw a classic "cold" function rather than a static inline function.
Since the function shall be rarely called, there is no point in inlining/duplicating it
in several units.
2023-04-16 19:26:15 +02:00
Patrick Pelissier 7279011f0a Use of the builtin versions of setjmp /longjmp for GCC / CLANG
They are more than twice faster on extreme bench of M\_LET / M\_TRY scenario
(and still twice slower than C++).
They also use less stack usage.
2023-04-16 19:18:04 +02:00
Patrick Pelissier 83e7f2a641 Use of new M_ATTR_NO_RETURN attribute 2023-04-15 22:50:47 +02:00
Patrick Pelissier 876c394fba Fix format 2023-03-28 23:42:25 +02:00
Patrick Pelissier 9f8b97ae46 Rename fields of m_exception_t:
data->context
n->num
2023-03-18 18:11:23 +01:00
Patrick Pelissier e33894f1b3 Finish support for M_DEFER / M_LET_IF & exceptions 2023-03-18 17:57:15 +01:00
Patrick Pelissier 0798480ad5 Refactoring & implement support for RAII with M_DEFER 2023-03-18 17:39:56 +01:00
Patrick Pelissier 42111ec22a Rename field of m_exception_t 2023-03-17 22:13:18 +01:00
Patrick Pelissier dfed8dbc50 Fix format 2023-03-13 23:53:26 +01:00
Patrick Pelissier bfa948dc7a Add WIP implementation for the exception memory model:
add header m-try that defines the M_TRY / M_CATCH macros
that macros similarly to the C++ try / catch keywords.
Add implementation for C++, GCC, CLANG and pure C compiler.
2023-03-13 23:31:50 +01:00