ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
newhand.cpp
Go to the documentation of this file.
1 
6 #if defined(__GNUC__) && (__GNUC__ < 4)
7  #include <iostream.h>
8  #include <new.h>
9 #elif defined(_MSC_VER)
10  #include <iostream>
11  #include <new.h>
12 #else
13  #include <iostream>
14  #include <new>
15 #endif
16 
17 #include <admodel.h>
18 
19 extern "C" {
20 
21 #if defined(_MSC_VER) // will need to deal with different VC versions
22 int adnewhandler(size_t i)
23 #else
24 void adnewhandler(void)
25 #endif
26 {
27  cout << "Memory allocation error -- Perhaps you are trying to allocate too"
28  " much memory in your program "<< endl;
29  ad_exit(1);
30 #if defined(_MSC_VER) // will need to deal with different VC versions
31  return 0;
32 #endif
33 }
34 
35 } // extern "C"
36 
41 void ad_set_new_handler (void)
42 {
43 #if defined(_MSC_VER) // will need to deal with different VC versions
44  _set_new_handler (adnewhandler);
45 #else
46  std::set_new_handler(adnewhandler);
47 #endif
48 }
exitptr ad_exit
Definition: gradstrc.cpp:53
void ad_set_new_handler(void)
Description not yet available.
Definition: newhand.cpp:41
prnstream & endl(prnstream &)
void adnewhandler(void)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Definition: newhand.cpp:24
Description not yet available.