summaryrefslogtreecommitdiffstats
path: root/sandbox
diff options
context:
space:
mode:
authorvictorw@chromium.org <victorw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-22 18:37:42 +0000
committervictorw@chromium.org <victorw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-22 18:37:42 +0000
commit817e1dd8ae6ed6be46c408a7c7ee579888f55e67 (patch)
tree5bf208ae044c9dc0679f0e0b33bc50f6e26da6df /sandbox
parent7ded59aeeb3e8423ea9893f98b998a15493e88df (diff)
downloadchromium_src-817e1dd8ae6ed6be46c408a7c7ee579888f55e67.zip
chromium_src-817e1dd8ae6ed6be46c408a7c7ee579888f55e67.tar.gz
chromium_src-817e1dd8ae6ed6be46c408a7c7ee579888f55e67.tar.bz2
Fix compiler error in sandbox util in case exception is enabled.
Add operator delete that matches the placement form of the operator new. This is required by compiler to generate code to call operator delete in case the object's constructor throws an exception. See http://msdn.microsoft.com/en-us/library/cxdxz3x6.aspx R=rvargas BUG=none TEST=sandbox code compiles if exception is enabled. Review URL: http://codereview.chromium.org/2870017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50486 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox')
-rw-r--r--sandbox/src/sandbox_nt_util.cc6
-rw-r--r--sandbox/src/sandbox_nt_util.h6
2 files changed, 12 insertions, 0 deletions
diff --git a/sandbox/src/sandbox_nt_util.cc b/sandbox/src/sandbox_nt_util.cc
index 10399fe..1452c6b 100644
--- a/sandbox/src/sandbox_nt_util.cc
+++ b/sandbox/src/sandbox_nt_util.cc
@@ -560,6 +560,12 @@ void operator delete(void* memory, sandbox::AllocationType type) {
}
}
+void operator delete(void* memory, sandbox::AllocationType type,
+ void* near_to) {
+ UNREFERENCED_PARAMETER(near_to);
+ operator delete(memory, type);
+}
+
void* __cdecl operator new(size_t size, void* buffer,
sandbox::AllocationType type) {
UNREFERENCED_PARAMETER(size);
diff --git a/sandbox/src/sandbox_nt_util.h b/sandbox/src/sandbox_nt_util.h
index 99657f5..7a82302 100644
--- a/sandbox/src/sandbox_nt_util.h
+++ b/sandbox/src/sandbox_nt_util.h
@@ -13,6 +13,12 @@
void* __cdecl operator new(size_t size, sandbox::AllocationType type,
void* near_to = NULL);
void __cdecl operator delete(void* memory, sandbox::AllocationType type);
+// Add operator delete that matches the placement form of the operator new
+// above. This is required by compiler to generate code to call operator delete
+// in case the object's constructor throws an exception.
+// See http://msdn.microsoft.com/en-us/library/cxdxz3x6.aspx
+void __cdecl operator delete(void* memory, sandbox::AllocationType type,
+ void* near_to);
// Regular placement new and delete
void* __cdecl operator new(size_t size, void* buffer,