You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit implements test_realloc to support dynamic adjustment
of memory sizes allocated by test_malloc or test_calloc.
In this commit, when shrinking an allocated block (e.g., from 100 bytes
to 10), memory corruption beyond the new size (such as m[i] for
10 <= i <= 99) cannot be detected. This limitation stems from
the fact that the original memory block is retained after shrinking.
While this approach helps avoid unnecessary memory copies, especially
in cases where memory is often expanded and reduced, it can leave
unused memory behind. Although this may improve performance when
memory is plentiful, it may also lead to wasted space.
There is still room for improvement in future versions to better
manage memory use and detect corruption when shrinking blocks.
Change-Id: Iebf68ea810c73549d966cb2305a5470863dacde5
0 commit comments