The following functions, macros, and classes are provided in new.h:
Name |
Description |
Header File new.h Syntax typedef void (*pvf)(); pvf _new_handler; Description _new_handler contains a pointer to a function that takes no arguments and returns void. If operator new() is unable to allocate the space required, it will call the function pointed to by _new_handler; if that function returns it will try the allocation again. By default, the function pointed to by _new_handler simply terminates the application. The application can replace this handler, however, with a function that can try to free up some space. This is done by assigning directly to _new_handler or by calling the function set_new_handler, which returns... more | |
Header File new.h Category Memory Routines Syntax typedef void (new * new_handler)(); new_handler set_new_handler(new_handler my_handler); Description set_new_handler installs the function to be called when the global operator new or operator new[]() cannot allocate the requested memory. By default the new operators throw an bad_alloc exception if memory cannot be allocated. You can change this default behavior by calling set_new_handler to set a new handler. To retain the traditional version of new, which does not throw exceptions, you can use set_new_handler(0). If new cannot allocate the requested memory, it calls the handler that was set by a previous call to set_new_handler.... more |
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
|
What do you think about this topic? Send feedback!
|