3 Copyright 2002, 2003, 2005, 2009 Red Hat, Inc.
5 This file is part of Cygwin.
7 This software is a copyrighted work licensed under the terms of the
8 Cygwin license. Please consult the file "CYGWIN_LICENSE" for
14 #include "cygwin-cxx.h"
16 /* These implementations of operators new and delete are used internally by
17 the DLL, and are kept separate from the user's/libstdc++'s versions by
18 use of LD's --wrap option. */
21 operator new (std::size_t s)
23 void *p = calloc (1, s);
28 operator delete (void *p)
34 operator new[] (std::size_t s)
36 return ::operator new (s);
40 operator delete[] (void *p)
42 ::operator delete (p);
45 /* Nothrow versions, provided only for completeness in the fallback array. */
48 operator new (std::size_t s, const std::nothrow_t &)
50 void *p = calloc (1, s);
55 operator delete (void *p, const std::nothrow_t &)
61 operator new[] (std::size_t s, const std::nothrow_t &nt)
63 return ::operator new (s, nt);
67 operator delete[] (void *p, const std::nothrow_t &nt)
69 ::operator delete (p, nt);
74 __cxa_pure_virtual (void)
76 api_fatal ("pure virtual method called");
80 __cxa_guard_acquire ()
85 __cxa_guard_release ()
89 /* These routines are made available as last-resort fallbacks
90 for the application. Should not be used in practice. */
92 struct per_process_cxx_malloc default_cygwin_cxx_malloc =
101 &(operator delete[]),