Data Alignment

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Data Alignment.

The following C run-time functions support data alignment.

Data-Alignment Routines

RoutineUse.NET Framework equivalent
_aligned_freeFrees a block of memory that was allocated with _aligned_mallocor _aligned_offset_malloc.Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.
_aligned_free_dbgFrees a block of memory that was allocated with _aligned_malloc or _aligned_offset_malloc (debug only).Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.
_aligned_mallocAllocates memory on a specified alignment boundary.Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.
_aligned_malloc_dbgAllocates memory on a specified alignment boundary with additional space for a debugging header and overwrite buffers (debug version only).Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.
_aligned_msizeReturns the size of a memory block allocated in the heap.Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.
_aligned_msize_dbgReturns the size of a memory block allocated in the heap (debug version only).Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.
_aligned_offset_mallocAllocates memory on a specified alignment boundary.Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.
_aligned_offset_malloc_dbgAllocates memory on a specified alignment boundary (debug version only).Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.
_aligned_offset_reallocChanges the size of a memory block that was allocated with _aligned_malloc or _aligned_offset_malloc.Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.
_aligned_offset_realloc_dbgChanges the size of a memory block that was allocated with _aligned_malloc or _aligned_offset_malloc (debug version only).Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.
_aligned_offset_recallocChanges the size of a memory block that was allocated with _aligned_malloc or _aligned_offset_malloc and initializes the memory to 0.Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.
_aligned_offset_recalloc_dbgChanges the size of a memory block that was allocated with _aligned_malloc or _aligned_offset_malloc and initializes the memory to 0 (debug version only).Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.
_aligned_reallocChanges the size of a memory block that was allocated with _aligned_malloc or _aligned_offset_malloc.Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.
_aligned_realloc_dbgChanges the size of a memory block that was allocated with _aligned_malloc or _aligned_offset_malloc (debug version only).Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.
_aligned_recallocChanges the size of a memory block that was allocated with _aligned_malloc or _aligned_offset_malloc and initializes the memory to 0.Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.
_aligned_recalloc_dbgChanges the size of a memory block that was allocated with _aligned_malloc or _aligned_offset_malloc and initializes the memory to 0 (debug version only).Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.

Run-Time Routines by Category

Show: