Deprecate the BASE_EMBEDDED macro
This was causing more confusion than benefit, so we're removing it. It's re-defined to empty for now, to avoid touching the ~100 files which use it, we can remove it completely during a quiet period when it's less likely to conflict with other work. Review-Url: https://codereview.chromium.org/2535383005 Cr-Commit-Position: refs/heads/master@{#41393}
This commit is contained in:
parent
9ef7ab1e2e
commit
80b920124c
@ -32,23 +32,6 @@ void Malloced::Delete(void* p) {
|
||||
}
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
static void* invalid = static_cast<void*>(NULL);
|
||||
|
||||
void* Embedded::operator new(size_t size) {
|
||||
UNREACHABLE();
|
||||
return invalid;
|
||||
}
|
||||
|
||||
|
||||
void Embedded::operator delete(void* p) {
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
char* StrDup(const char* str) {
|
||||
int length = StrLength(str);
|
||||
char* result = NewArray<char>(length + 1);
|
||||
|
@ -26,24 +26,9 @@ class V8_EXPORT_PRIVATE Malloced {
|
||||
static void Delete(void* p);
|
||||
};
|
||||
|
||||
|
||||
// A macro is used for defining the base class used for embedded instances.
|
||||
// The reason is some compilers allocate a minimum of one word for the
|
||||
// superclass. The macro prevents the use of new & delete in debug mode.
|
||||
// In release mode we are not willing to pay this overhead.
|
||||
|
||||
#ifdef DEBUG
|
||||
// Superclass for classes with instances allocated inside stack
|
||||
// activations or inside other objects.
|
||||
class Embedded {
|
||||
public:
|
||||
void* operator new(size_t size);
|
||||
void operator delete(void* p);
|
||||
};
|
||||
#define BASE_EMBEDDED : public NON_EXPORTED_BASE(Embedded)
|
||||
#else
|
||||
// DEPRECATED
|
||||
// TODO(leszeks): Delete this during a quiet period
|
||||
#define BASE_EMBEDDED
|
||||
#endif
|
||||
|
||||
|
||||
// Superclass for classes only using static method functions.
|
||||
|
Loading…
Reference in New Issue
Block a user