Skip to content

Latest commit

 

History

History
50 lines (35 loc) · 3.09 KB

aligned-free-dbg.md

File metadata and controls

50 lines (35 loc) · 3.09 KB
description title ms.date api_name api_location api_type topic_type f1_keywords helpviewer_keywords ms.assetid
Learn more about: _aligned_free_dbg
_aligned_free_dbg
11/04/2016
_aligned_free_dbg
msvcrt.dll
msvcr80.dll
msvcr90.dll
msvcr100.dll
msvcr100_clr0400.dll
msvcr110.dll
msvcr110_clr0400.dll
msvcr120.dll
msvcr120_clr0400.dll
ucrtbase.dll
DLLExport
apiref
_aligned_free_dbg
aligned_free_dbg
_aligned_free_dbg function
aligned_free_dbg function
eb0cb3c8-0992-4db8-bac3-65f1b8311ca6

_aligned_free_dbg

Frees a block of memory that was allocated with _aligned_malloc or _aligned_offset_malloc (debug only).

Syntax

void _aligned_free_dbg(
   void *memblock
);

Parameters

memblock
A pointer to the memory block that was returned to the _aligned_malloc or _aligned_offset_malloc function.

Remarks

The _aligned_free_dbg function is a debug version of the _aligned_free function. When _DEBUG isn't defined, each call to _aligned_free_dbg is reduced to a call to _aligned_free. Both _aligned_free and _aligned_free_dbg free a memory block in the base heap, but _aligned_free_dbg accommodates a debugging feature: the ability to keep freed blocks in the heap's linked list to simulate low memory conditions.

_aligned_free_dbg performs a validity check on all specified files and block locations before performing the free operation. The application isn't expected to provide this information. When a memory block is freed, the debug heap manager automatically checks the integrity of the buffers on either side of the user portion. It issues an error report if overwriting has occurred. If the _CRTDBG_DELAY_FREE_MEM_DF bit field of the _crtDbgFlag flag is set, the freed block is filled with the value 0xDD, assigned the _FREE_BLOCK block type, and kept in the heap's linked list of memory blocks.

If an error occurs in freeing the memory, errno is set with information from the operating system on the nature of the failure. For more information, see errno, _doserrno, _sys_errlist, and _sys_nerr.

For information about how memory blocks are allocated, initialized, and managed in the debug version of the base heap, see CRT debug heap details. For information about the allocation block types and how they're used, see Types of blocks on the debug heap. For information about the differences between standard heap functions and their debug versions, see Debug versions of heap allocation functions.

Requirements

Routine Required header
_aligned_free_dbg <crtdbg.h>

For more compatibility information, see Compatibility.

See also

Debug routines