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

Side by Side Diff: ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_memory.cc

Issue 7740013: Cloning a bunch of stuff from the native_client repository at r6528 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 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
(Empty)
1 // Copyright (c) 2011 The Native Client 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.
4
5 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_memory.h"
6
7 #include <cstdlib>
8
9 #include "native_client/src/include/portability.h"
10 #include "native_client/src/shared/ppapi_proxy/utility.h"
11 #include "ppapi/c/dev/ppb_memory_dev.h"
12
13 namespace ppapi_proxy {
14
15 namespace {
16
17 void* MemAlloc(uint32_t num_bytes) {
18 DebugPrintf("PPB_Memory_Dev::MemAlloc(%"NACL_PRIu32")\n", num_bytes);
19 return std::malloc(num_bytes);
20 }
21
22 void MemFree(void* ptr) {
23 DebugPrintf("PPB_Memory_Dev::MemFree(%p)\n", ptr);
24 std::free(ptr);
25 }
26
27 } // namespace
28
29 const PPB_Memory_Dev* PluginMemory::GetInterface() {
30 static const PPB_Memory_Dev memory_interface = {
31 MemAlloc,
32 MemFree
33 };
34 return &memory_interface;
35 }
36
37 } // namespace ppapi_proxy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698