[DEBUG] correct Allocator.hpp missing

This commit is contained in:
Edouard DUPIN 2017-10-14 12:22:11 +02:00
parent a42db849c4
commit 2a02c0c0be
3 changed files with 20 additions and 12 deletions

View File

@ -4,7 +4,7 @@
* @license MPL v2.0 (see license file)
*/
//#include <etk/types.hpp>
#include <etk/Allocator.hpp>
#include <stdlib.h>
/*
void* operator new (size_t size) {
@ -26,14 +26,3 @@ void operator delete[] (void* ptr) {
*/
// it is define bu generic "include <new>" ==> no double define of placement new
#ifndef _NEW
// Default placement versions of operator new (use char* instead of void* to permit no multiple definition).
inline void* operator new(size_t, char* _p) throw() {
ETK_VECTOR_DEBUG("plop\n");
return _p;
}
inline void operator delete (void*, char*) throw() {
}
#endif

18
etk/Allocator.hpp Normal file
View File

@ -0,0 +1,18 @@
/** @file
* @author Edouard DUPIN
* @copyright 2017, Edouard DUPIN, all right reserved
* @license MPL v2.0 (see license file)
*/
#pragma once
#include <etk/types.hpp>
// it is define bu generic "include <new>" ==> no double define of placement new
#ifndef _NEW
// Default placement versions of operator new (use char* instead of void* to permit no multiple definition).
inline void* operator new(size_t, char* _p) throw() {
return _p;
}
inline void operator delete (void*, char*) throw() {
}
#endif

View File

@ -40,6 +40,7 @@ def configure(target, my_module):
])
my_module.add_header_file([
'etk/Allocator.hpp',
'etk/types.hpp',
'etk/stdTools.hpp',
'etk/Buffer.hpp',