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

Side by Side Diff: third_party/WebKit/Source/wtf/allocator/Partitions.h

Issue 2494823002: V8ScriptValueSerializer: Use PartitionAlloc for the buffer, and avoid copying it into a String. (Closed)
Patch Set: initialize SerializedScriptValue::m_dataBufferSize 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
« no previous file with comments | « third_party/WebKit/Source/bindings/modules/v8/SerializedScriptValueForModulesFactory.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 static void decommitFreeableMemory(); 84 static void decommitFreeableMemory();
85 85
86 static void reportMemoryUsageHistogram(); 86 static void reportMemoryUsageHistogram();
87 87
88 static void dumpMemoryStats(bool isLightDump, PartitionStatsDumper*); 88 static void dumpMemoryStats(bool isLightDump, PartitionStatsDumper*);
89 89
90 ALWAYS_INLINE static void* bufferMalloc(size_t n, const char* typeName) { 90 ALWAYS_INLINE static void* bufferMalloc(size_t n, const char* typeName) {
91 return partitionAllocGeneric(bufferPartition(), n, typeName); 91 return partitionAllocGeneric(bufferPartition(), n, typeName);
92 } 92 }
93 ALWAYS_INLINE static void* bufferRealloc(void* p,
94 size_t n,
95 const char* typeName) {
96 return partitionReallocGeneric(bufferPartition(), p, n, typeName);
97 }
93 ALWAYS_INLINE static void bufferFree(void* p) { 98 ALWAYS_INLINE static void bufferFree(void* p) {
94 partitionFreeGeneric(bufferPartition(), p); 99 partitionFreeGeneric(bufferPartition(), p);
95 } 100 }
96 ALWAYS_INLINE static size_t bufferActualSize(size_t n) { 101 ALWAYS_INLINE static size_t bufferActualSize(size_t n) {
97 return partitionAllocActualSize(bufferPartition(), n); 102 return partitionAllocActualSize(bufferPartition(), n);
98 } 103 }
99 static void* fastMalloc(size_t n, const char* typeName) { 104 static void* fastMalloc(size_t n, const char* typeName) {
100 return partitionAllocGeneric(Partitions::fastMallocPartition(), n, 105 return partitionAllocGeneric(Partitions::fastMallocPartition(), n,
101 typeName); 106 typeName);
102 } 107 }
(...skipping 30 matching lines...) Expand all
133 // - Fast malloc partition: A partition to allocate all other objects. 138 // - Fast malloc partition: A partition to allocate all other objects.
134 static PartitionAllocatorGeneric m_fastMallocAllocator; 139 static PartitionAllocatorGeneric m_fastMallocAllocator;
135 static PartitionAllocatorGeneric m_bufferAllocator; 140 static PartitionAllocatorGeneric m_bufferAllocator;
136 static SizeSpecificPartitionAllocator<1024> m_layoutAllocator; 141 static SizeSpecificPartitionAllocator<1024> m_layoutAllocator;
137 static ReportPartitionAllocSizeFunction m_reportSizeFunction; 142 static ReportPartitionAllocSizeFunction m_reportSizeFunction;
138 }; 143 };
139 144
140 } // namespace WTF 145 } // namespace WTF
141 146
142 #endif // Partitions_h 147 #endif // Partitions_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/modules/v8/SerializedScriptValueForModulesFactory.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698