Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(301)

Side by Side Diff: third_party/libjingle/overrides/allocator_shim/allocator_proxy.cc

Issue 17569006: Support using loadable module for libpeerconnection on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: code review Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "allocator_shim/allocator_stub.h" 5 #include "allocator_shim/allocator_stub.h"
6 6
7 #if !defined(LIBPEERCONNECTION_IMPLEMENTATION) || defined(LIBPEERCONNECTION_LIB) 7 #if !defined(LIBPEERCONNECTION_IMPLEMENTATION) || defined(LIBPEERCONNECTION_LIB)
8 #error "Only compile the allocator proxy with the shared_library implementation" 8 #error "Only compile the allocator proxy with the shared_library implementation"
9 #endif 9 #endif
10 10
11 #if defined(OS_MACOSX) 11 #if defined(OS_MACOSX) || defined(OS_ANDROID)
12 #error "The allocator proxy isn't supported (or needed) on mac." 12 #error "The allocator proxy isn't supported (or needed) on mac or android."
13 #endif 13 #endif
14 14
15 extern AllocateFunction g_alloc; 15 extern AllocateFunction g_alloc;
16 extern DellocateFunction g_dealloc; 16 extern DellocateFunction g_dealloc;
17 17
18 // Override the global new/delete routines and proxy them over to the allocator 18 // Override the global new/delete routines and proxy them over to the allocator
19 // routines handed to us via InitializeModule. 19 // routines handed to us via InitializeModule.
20 20
21 void* operator new(std::size_t n) throw() { 21 void* operator new(std::size_t n) throw() {
22 return g_alloc(n); 22 return g_alloc(n);
23 } 23 }
24 24
25 void operator delete(void* p) throw() { 25 void operator delete(void* p) throw() {
26 g_dealloc(p); 26 g_dealloc(p);
27 } 27 }
OLDNEW
« no previous file with comments | « third_party/libjingle/libjingle.gyp ('k') | third_party/libjingle/overrides/allocator_shim/allocator_stub.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698