Initial post does not give enough actionable details about the use case, so I can’t give feedback that would be safe for every scenario. And even if it had, I don’t think it would be a safe answer. So I’d rather avoid suggesting something that could be dangerous in certain cases.
Therefore, I’d recommend treating a max size change as a data-layout change and doing a proper migration instead of modifying the bound in place.
The safest approach is to define a new “v2” type/structure with the new bond and new memory id. Copy existing data into it with proper migration/transformation if needed. Switch to v2 once the copy completes.
Currently it still keeps allocated memory tied to v1 structure. You might use it later in the future when doing another layout-change migration and re-use this memory id for v3.
We are currently working on additional options to re-claim previously used memory to improve the situation.