Motivation: We should also use realloc when shrink the buffer to eliminate extra allocations / memory copies when possible. Modifications: Use realloc for expanding and shrinking when possible. Result: Less memory copies and allocations
Motivation: We should also use realloc when shrink the buffer to eliminate extra allocations / memory copies when possible. Modifications: Use realloc for expanding and shrinking when possible. Result: Less memory copies and allocations