Shrink the buffer, but only if it is allocated on the heap.
| 1295 | |
| 1296 | // Shrink the buffer, but only if it is allocated on the heap. |
| 1297 | void Binary_string::shrink(size_t arg_length) |
| 1298 | { |
| 1299 | if (is_alloced() && ALIGN_SIZE(arg_length + 1) < Alloced_length) |
| 1300 | { |
| 1301 | /* my_realloc() can't fail as new buffer is less than the original one */ |
| 1302 | Ptr= (char*) my_realloc(STRING_PSI_MEMORY_KEY, Ptr, arg_length, |
| 1303 | MYF(thread_specific ? |
| 1304 | MY_THREAD_SPECIFIC : 0)); |
| 1305 | Alloced_length= (uint32) arg_length; |
| 1306 | } |
| 1307 | } |
no test coverage detected