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

Side by Side Diff: base/allocator/partition_allocator/partition_allocator.cc

Issue 2518253002: Move Partition Allocator into Chromium base. (Closed)
Patch Set: Created 4 years, 1 month 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
OLDNEW
(Empty)
1 // Copyright (c) 2014 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.
4
5 #include "base/allocator/partition_allocator/partition_allocator.h"
6
7 #include "base/allocator/partition_allocator/partition_alloc.h"
8 #include "base/allocator/partition_allocator/partitions.h"
9
10 namespace base {
11
12 void* PartitionAllocator::allocateBacking(size_t size, const char* typeName) {
13 return Partitions::bufferMalloc(size, typeName);
14 }
15
16 void PartitionAllocator::freeVectorBacking(void* address) {
17 Partitions::bufferFree(address);
18 }
19
20 void PartitionAllocator::freeHashTableBacking(void* address) {
21 Partitions::bufferFree(address);
22 }
23
24 template <>
25 char* PartitionAllocator::allocateVectorBacking<char>(size_t size) {
26 return reinterpret_cast<char*>(
27 allocateBacking(size, "PartitionAllocator::allocateVectorBacking<char>"));
28 }
29
30 template <>
31 char* PartitionAllocator::allocateExpandedVectorBacking<char>(size_t size) {
32 return reinterpret_cast<char*>(allocateBacking(
33 size, "PartitionAllocator::allocateExpandedVectorBacking<char>"));
34 }
35
36 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698