Fix crash on app list start page contents not existing.
[chromium-blink-merge.git] / third_party / libjingle / overrides / allocator_shim / allocator_proxy.cc
blob515cad4327da64d73a35395a5c3df7c15582774d
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "allocator_shim/allocator_stub.h"
7 #if !defined(LIBPEERCONNECTION_IMPLEMENTATION) || defined(LIBPEERCONNECTION_LIB)
8 #error "Only compile the allocator proxy with the shared_library implementation"
9 #endif
11 #if defined(OS_MACOSX) || defined(OS_ANDROID)
12 #error "The allocator proxy isn't supported (or needed) on mac or android."
13 #endif
15 extern AllocateFunction g_alloc;
16 extern DellocateFunction g_dealloc;
18 // Override the global new/delete routines and proxy them over to the allocator
19 // routines handed to us via InitializeModule.
21 void* operator new(std::size_t n) throw() {
22 return g_alloc(n);
25 void operator delete(void* p) throw() {
26 g_dealloc(p);