(MOD) Fixed 1 bug in Memory_Reallocate: Now the size of inst is updating with the given size used for reallocation.

(MOD) Replaced struct member prev from UnknownStatus, NormalStatus and ErrorStatus from NULL to &UnknownStatus, &NormalStatus and &ErrorStatus.

(MOD) Rewrote Status_Equal, StatusUtils_Dump, StatusUtils_IsRecursive and StatusUtils_Depth in response to the change of struct member prev from UnknownStatus, NormalStatus and ErrorStatus.

(MOD) Defined 1 more macro "shift".
This commit is contained in:
2024-06-27 16:01:01 +08:00
parent 310586ab86
commit 9f2b44bf99
5 changed files with 76 additions and 51 deletions

View File

@@ -33,7 +33,10 @@ Status Memory_Reallocate(Memory *inst, size_t size)
/* When failed on reallocating. */
state(!(inst->addr = realloc(inst->addr, size)),
apply(error(InsufficientMemory, "Unsuccessful reallocation was received.")));
apply(error(InsufficientMemory, "Cannot successfully reallocate.")));
/* Update size from inst. */
inst->size = size;
return apply(NormalStatus);
}