gcc/libsanitizer/sanitizer_common/sanitizer_placement_new.h
Kostya Serebryany ef1b3fda32 libsanitizer merge from upstream r191666
This may break gcc-asan on Mac, will follow up separately.

From-SVN: r204368
2013-11-04 21:33:31 +00:00

32 lines
982 B
C++

//===-- sanitizer_placement_new.h -------------------------------*- C++ -*-===//
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file is shared between AddressSanitizer and ThreadSanitizer
// run-time libraries.
//
// The file provides 'placement new'.
// Do not include it into header files, only into source files.
//===----------------------------------------------------------------------===//
#ifndef SANITIZER_PLACEMENT_NEW_H
#define SANITIZER_PLACEMENT_NEW_H
#include "sanitizer_internal_defs.h"
namespace __sanitizer {
#if (SANITIZER_WORDSIZE == 64) || SANITIZER_MAC
typedef uptr operator_new_ptr_type;
#else
typedef u32 operator_new_ptr_type;
#endif
} // namespace __sanitizer
inline void *operator new(__sanitizer::operator_new_ptr_type sz, void *p) {
return p;
}
#endif // SANITIZER_PLACEMENT_NEW_H