forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmemory_dev.cc
More file actions
33 lines (24 loc) · 773 Bytes
/
memory_dev.cc
File metadata and controls
33 lines (24 loc) · 773 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright 2011 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ppapi/cpp/dev/memory_dev.h"
#include "ppapi/c/dev/ppb_memory_dev.h"
#include "ppapi/cpp/module.h"
#include "ppapi/cpp/module_impl.h"
namespace pp {
namespace {
template <> const char* interface_name<PPB_Memory_Dev>() {
return PPB_MEMORY_DEV_INTERFACE;
}
} // namespace
void* Memory_Dev::MemAlloc(uint32_t num_bytes) {
if (!has_interface<PPB_Memory_Dev>())
return NULL;
return get_interface<PPB_Memory_Dev>()->MemAlloc(num_bytes);
}
void Memory_Dev::MemFree(void* ptr) {
if (!has_interface<PPB_Memory_Dev>() || !ptr)
return;
get_interface<PPB_Memory_Dev>()->MemFree(ptr);
}
} // namespace pp