This was an old test, i'll try to repeat it. Did not remember exactly fb version.I am interested and surprised by this behavior where REALLOCATE fails, but another separate ALLOCATE (with the same size) succeeds ?
Context : I needed a pre allocated zstring available for being used very fast (no need to reallocate)
The size shall be known, logically fixed, but with possible resize to bigger size (never smaller)
The zstring is in a class.
The zstring resize request is inside a property of this class.
As the property was used many and many times, random crashes occured.
Replacing reallocate by allocate + swap did solve the problem. (Smell like a sticky hack)
=> I supposed the new allocated could find available memory outside the class wheras the reallocate was trying finding space into the same area inside class definition ??
( Or reallocate did break class desc integrity)
Usage : you handle a list of key-values, but.., at one moment, because an error or anything else, the key is becoming huge just for a few keys, and this 'exception' shall be handled as a standard key, for robustness.
( ou sinon, c'est la clef qui pète la classe, .. ;- )