Export (0) Print
Expand All
div
Expand Minimize

_aligned_offset_realloc

Changes the size of a memory block that was allocated with _aligned_malloc or _aligned_offset_malloc.

void * _aligned_offset_realloc(
   void *memblock, 
   size_t size, 
   size_t alignment,
   size_t offset
);

Parameters

memblock
The current memory block pointer.
size
The size of the memory allocation.
alignment
The alignment value, which must be an integer power of 2.
offset
The offset into the memory allocation to force the alignment.

Return Value

_aligned_offset_realloc returns a void pointer to the reallocated (and possibly moved) memory block. The return value is NULL if the size is zero and the buffer argument is not NULL, or if there is not enough available memory to expand the block to the given size. In the first case, the original block is freed. In the second case, the original block is unchanged. The return value points to a storage space that is guaranteed to be suitably aligned for storage of any type of object. To get a pointer to a type other than void, use a type cast on the return value.

Remarks

Like _aligned_offset_malloc, _aligned_offset_realloc allows a structure to be aligned at an offset within the structure.

_aligned_offset_realloc is based on malloc; see malloc for more information on using _aligned_offset_malloc.

Requirements

Routine Required header Compatibility
_aligned_offset_realloc <malloc.h> Win 98, Win Me, Win NT, Win 2000, Win XP

For additional compatibility information, see Compatibility in the Introduction.

Libraries

All versions of the C run-time libraries.

Example

See _aligned_malloc for a sample that uses _aligned_offset_realloc.

See Also

Data Alignment | Run-Time Routines and .NET Framework Equivalents

Show:
© 2014 Microsoft