(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:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user