Skip to content

Commit 12ffd1f

Browse files
authored
Merge pull request #2565 from MicrosoftDocs/master
12/12 AM Publish
2 parents 1d1332b + 902afbd commit 12ffd1f

File tree

2 files changed

+75
-61
lines changed

2 files changed

+75
-61
lines changed

docs/c-runtime-library/reference/aligned-malloc.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "_aligned_malloc"
3-
ms.date: "11/04/2016"
3+
ms.date: "12/11/2019"
44
api_name: ["_aligned_malloc"]
55
api_location: ["msvcrt.dll", "msvcr80.dll", "msvcr90.dll", "msvcr100.dll", "msvcr100_clr0400.dll", "msvcr110.dll", "msvcr110_clr0400.dll", "msvcr120.dll", "msvcr120_clr0400.dll", "ucrtbase.dll", "api-ms-win-crt-heap-l1-1-0.dll"]
66
api_type: ["DLLExport"]
@@ -42,6 +42,8 @@ A pointer to the memory block that was allocated or NULL if the operation failed
4242

4343
This function sets `errno` to `ENOMEM` if the memory allocation failed or if the requested size was greater than `_HEAP_MAXREQ`. For more information about `errno`, see [errno, _doserrno, _sys_errlist, and _sys_nerr](../../c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr.md). Also, **_aligned_malloc** validates its parameters. If *alignment* is not a power of 2 or *size* is zero, this function invokes the invalid parameter handler, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, this function returns NULL and sets `errno` to `EINVAL`.
4444

45+
Use [_aligned_free](aligned-free.md) to deallocate memory obtained by both **_aligned_malloc** and `_aligned_offset_malloc`. Don't use `free`, which doesn't reclaim the aligned memory correctly and can lead to hard-to-diagnose bugs.
46+
4547
## Requirements
4648

4749
|Routine|Required header|
@@ -132,4 +134,4 @@ This pointer, 3280891, is offset by 5 on alignment of 16
132134

133135
## See also
134136

135-
[Data Alignment](../../c-runtime-library/data-alignment.md)
137+
[Data Alignment](../../c-runtime-library/data-alignment.md)

0 commit comments

Comments
 (0)