File: new

package info (click to toggle)
gcc-m68k-linux 2.8.1-1
  • links: PTS
  • area: main
  • in suites: potato, slink
  • size: 35,132 kB
  • ctags: 38,609
  • sloc: ansic: 390,817; asm: 9,529; yacc: 8,727; sh: 6,962; cpp: 2,371; makefile: 1,931; objc: 482; sed: 316; pascal: 133
file content (48 lines) | stat: -rw-r--r-- 1,168 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// The -*- C++ -*- dynamic memory management header.
// Copyright (C) 1994, 1996 Free Software Foundation

#ifndef __NEW__
#define __NEW__

#pragma interface "new"
#include <stddef.h>
#include <exception>

extern "C++" {

#if 0
namespace std {
#endif

  class bad_alloc : public exception {
  public:
    virtual const char* what() const throw() { return "bad_alloc"; }
  };

  struct nothrow_t {};
  extern const nothrow_t nothrow;
  typedef void (*new_handler)();
  extern "C" new_handler set_new_handler (new_handler);

#if 0
} // namespace std
#endif

// G++ implementation internals
extern new_handler __new_handler;
extern "C" void __default_new_handler (void);

// replaceable signatures
void *operator new (size_t);
void *operator new (size_t, const nothrow_t&) throw();
void *operator new[] (size_t);
void *operator new[] (size_t, const nothrow_t&) throw();
void operator delete (void *) throw();
void operator delete[] (void *) throw();

// default placement versions of operator new
inline void *operator new(size_t, void *place) throw() { return place; }
inline void *operator new[](size_t, void *place) throw() { return place; }
} // extern "C++"

#endif