Commit 7db050e5 authored by thakis's avatar thakis Committed by Commit bot

Remove NT_PLACE, it's not really used.

operator new(size_t size, void* buffer, sandbox::AllocationType type) just
returns buffer, which is what the default placement new operator does too.

No intended behavior change.

(The motivation is to get rid of the two "return NULL"s in
`operator delete(void* memory, sandbox::AllocationType type)`, as they are
undefined behavior.)

BUG=none

Review URL: https://codereview.chromium.org/544333002

Cr-Commit-Position: refs/heads/master@{#294119}
parent 387942c0
......@@ -4,6 +4,10 @@
#include "sandbox/win/src/resolver.h"
// For placement new. This file must not depend on the CRT at runtime, but
// placement operator new is inline.
#include <new>
#include "sandbox/win/src/sandbox_nt_util.h"
namespace {
......@@ -62,7 +66,7 @@ bool ResolverThunk::SetInternalThunk(void* storage, size_t storage_bytes,
if (storage_bytes < sizeof(InternalThunk))
return false;
InternalThunk* thunk = new(storage, NT_PLACE) InternalThunk;
InternalThunk* thunk = new(storage) InternalThunk;
#pragma warning(push)
#pragma warning(disable: 4311)
......
......@@ -4,6 +4,10 @@
#include "sandbox/win/src/resolver.h"
// For placement new. This file must not depend on the CRT at runtime, but
// placement operator new is inline.
#include <new>
#include "sandbox/win/src/sandbox_nt_util.h"
namespace {
......@@ -53,7 +57,7 @@ bool ResolverThunk::SetInternalThunk(void* storage, size_t storage_bytes,
if (storage_bytes < sizeof(InternalThunk))
return false;
InternalThunk* thunk = new(storage, NT_PLACE) InternalThunk;
InternalThunk* thunk = new(storage) InternalThunk;
thunk->interceptor_function = reinterpret_cast<ULONG_PTR>(interceptor);
return true;
......
......@@ -37,7 +37,6 @@ struct NtExports {
// This is the value used for the ntdll level allocator.
enum AllocationType {
NT_ALLOC,
NT_PLACE,
NT_PAGE
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment