Make M*LIB stricter for INIT_MOVE operator:

* either the default INIT_MOVE operator works ('=')
* either an INIT_MOVE method is defined
* or it is disabled.
As a consequence, fix usage of testobj_t and mpz_t in the repository

The emulation layer of INIT_MOVE using INIT_SET+CLEAR is removed:
it wasn't working correctly with the local memory context
(INIT_MOVE doesn't need any local memory context to work,
 whereas INIT_SET/CLEAR does)
Remove macro M_DO_INIT_MOVE as it is now useless and uses M_CALL_INIT_MOVE.

The INIT_MOVE default method no longer sets the old 'src' to '0':
it was useless (it doesn't catch any error) and complicates compiler parsing.

Fix POD & A1 & CSTR & classic oplists definition (missing INIT_MOVE operators).
This commit is contained in:
Patrick Pelissier committed 2025-05-07 21:02:24 +02:00
1 parent 3a39ce5a4a
commit d548117538
19 files changed
+126 -157

No files matched your search

+2
View File
@@ -99,3 +99,5 @@ V0.8.0 : * The prototypes of REALLOC / FREE operators are incompatible:
* m-buffer push / pop no longer return a bool (it was undocumented)
* Remove MEMPOOL support from list & R/B tree
* m-mempool: Header is obsolete (and no longer useful at all as lists & RB Tree no longer can use it. To remove?). Use new M_USE_POOL interface to pass local pool context.
* M*LIB becomes stricter for INIT_MOVE: Emulation layer using CLEAR+INIT_SET when missing INIT_MOVE operator has been removed: either default INIT_MOVE operator (operator '=') is working, or a methode is provided for INIT_MOVE or it is disabled.
(It's because supporting emulation layer with new memory context parameter was complicated)
+3 -3
View File
@@ -1,7 +1,7 @@
*Long term issues*
==========================================================
* TODO #34 : Pass old size arguments to memory allocator :ENHANCEMENT:
* DONE #34 : Pass old size arguments to memory allocator :ENHANCEMENT:
** State
@@ -53,7 +53,7 @@ function due to the copy of the object one per one. Each copied sub object
may throw an exception, so we always need to have the container in a correct
state so that it can be cleanup.
* TODO #32 : User specialization fields in the container :ENHANCEMENT:
* DONE #32 : User specialization fields in the container :ENHANCEMENT:
** State
Some methods of a contained object may need to have some options that
@@ -452,7 +452,7 @@ as DPRIORITY_QUEUE_DEF ?
NOTE: Needs for such container?
On hold until a user needs it.
* TODO #23 : Strict MOVE semantic to clarify :ENHANCEMENT:
* DONE #23 : Strict MOVE semantic to clarify :ENHANCEMENT:
** State