]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/tools/build/src/engine/boehm_gc/gc_cpp.cc
Add patch for failing prerm scripts
[ceph.git] / ceph / src / boost / tools / build / src / engine / boehm_gc / gc_cpp.cc
CommitLineData
7c673cae
FG
1/*************************************************************************
2Copyright (c) 1994 by Xerox Corporation. All rights reserved.
3
4THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
5OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
6
7 Last modified on Sat Nov 19 19:31:14 PST 1994 by ellis
8 on Sat Jun 8 15:10:00 PST 1994 by boehm
9
10Permission is hereby granted to copy this code for any purpose,
11provided the above notices are retained on all copies.
12
13This implementation module for gc_c++.h provides an implementation of
14the global operators "new" and "delete" that calls the Boehm
15allocator. All objects allocated by this implementation will be
16non-collectable but part of the root set of the collector.
17
18You should ensure (using implementation-dependent techniques) that the
19linker finds this module before the library that defines the default
20built-in "new" and "delete".
21
22Authors: John R. Ellis and Jesse Hull
23
24**************************************************************************/
25/* Boehm, December 20, 1994 7:26 pm PST */
26
27#include "gc_cpp.h"
28
29void* operator new( size_t size ) {
30 return GC_MALLOC_UNCOLLECTABLE( size );}
31
32void operator delete( void* obj ) {
33 GC_FREE( obj );}
34
35#ifdef GC_OPERATOR_NEW_ARRAY
36
37void* operator new[]( size_t size ) {
38 return GC_MALLOC_UNCOLLECTABLE( size );}
39
40void operator delete[]( void* obj ) {
41 GC_FREE( obj );}
42
43#endif /* GC_OPERATOR_NEW_ARRAY */
44
45#ifdef _MSC_VER
46
47// This new operator is used by VC++ in case of Debug builds !
48void* operator new( size_t size,
49 int ,//nBlockUse,
50 const char * szFileName,
51 int nLine )
52{
53#ifndef GC_DEBUG
54 return GC_malloc_uncollectable( size );
55#else
56 return GC_debug_malloc_uncollectable(size, szFileName, nLine);
57#endif
58}
59
60// This new operator is used by VC++ 7.0 and later in Debug builds.
61void* operator new[](size_t size, int nBlockUse, const char* szFileName, int nLine)
62{
63 return operator new(size, nBlockUse, szFileName, nLine);
64}
65
66#endif /* _MSC_VER */
67