Skip to content

Latest commit

 

History

History
51 lines (37 loc) · 2.21 KB

query-new-mode.md

File metadata and controls

51 lines (37 loc) · 2.21 KB
description title ms.date api_name api_location api_type topic_type f1_keywords helpviewer_keywords ms.assetid
Learn more about: _query_new_mode
_query_new_mode
11/04/2016
_query_new_mode
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
DLLExport
apiref
query_new_mode
_query_new_mode
query_new_mode function
handler modes
_query_new_mode function
e185c5f9-b73b-4257-8eff-b47648374768

_query_new_mode

Returns an integer indicating the new handler mode set by _set_new_mode for malloc.

Syntax

int _query_new_mode(
   void
);

Return value

Returns the current new handler mode, namely 0 or 1, for malloc. A return value of 1 indicates that, on failure to allocate memory, malloc calls the new handler routine; a return value of 0 indicates that it doesn't.

Remarks

The C++ _query_new_mode function returns an integer that indicates the new handler mode that is set by the C++ _set_new_mode function for malloc. The new handler mode indicates whether, on failure to allocate memory, malloc is to call the new handler routine as set by _set_new_handler. By default, malloc doesn't call the new handler routine on failure. You can use _set_new_mode to override this behavior so that on failure malloc calls the new handler routine in the same way that the new operator does when it fails to allocate memory. For more information, see the discussion of the new and delete operators in the C++ Language Reference.

Requirements

Routine Required header
_query_new_mode <new.h>

For more compatibility information, see Compatibility.

Libraries

All versions of the C run-time libraries.

See also

Memory allocation
calloc
free
realloc
_query_new_handler