Mercurial > libjeffpc
diff buffer_heap.c @ 261:6795f8427fed
buffer: allow buffer truncation
This is a similar idea to the POSIX truncate() function. It sets the used
buffer size to a certain value. If the new size is larger than the old
size, the newly visible bytes are zeroed out. If the new size is smaller
than the old size, the bytes at the end are "lost" but the underlying buffer
allocation remains unchanged.
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author | Josef 'Jeff' Sipek <jeffpc@josefsipek.net> |
---|---|
date | Tue, 11 Jul 2017 00:39:14 +0300 |
parents | f82b45b662c9 |
children | 0fa2f6606c5e |
line wrap: on
line diff