struct memory_block *post;
struct memory_block *ptr;
+ /* Sanity checks */
+ assert ( size != 0 );
+ assert ( ( align == 0 ) || ( ( align & ( align - 1 ) ) == 0 ) );
+
valgrind_make_blocks_defined();
/* Round up size to multiple of MIN_MEMBLOCK_SIZE and
/* Round up size to match actual size that alloc_memblock()
* would have used.
*/
+ assert ( size != 0 );
size = ( size + MIN_MEMBLOCK_SIZE - 1 ) & ~( MIN_MEMBLOCK_SIZE - 1 );
freeing = ptr;
VALGRIND_MAKE_MEM_DEFINED ( freeing, sizeof ( *freeing ) );
data );
VALGRIND_MAKE_MEM_DEFINED ( old_block, offsetof ( struct autosized_block, data ) );
old_total_size = old_block->size;
+ assert ( old_total_size != 0 );
old_size = ( old_total_size -
offsetof ( struct autosized_block, data ) );
memcpy ( new_ptr, old_ptr,