_aligned_offset_malloc
Visual Studio .NET 2003
Allocates memory on a specified alignment boundary.
void * _aligned_offset_malloc( size_t size, size_t alignment, size_t offset );
Parameters
- size
- The size of the requested 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
A pointer to the memory block that was allocated, or NULL if the operation failed.
Remarks
_aligned_offset_malloc is useful in situations where alignment is needed on a nested element, for example, if alignment was needed on a nested class.
_aligned_offset_malloc is based on malloc; see malloc for more information on using _aligned_offset_malloc.
Requirements
| Routine | Required header | Compatibility |
|---|---|---|
| _aligned_offset_malloc | <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_malloc.
See Also
Data Alignment | Run-Time Routines and .NET Framework Equivalents