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

Unified Diff: base/metrics/persistent_memory_allocator.h

Issue 2016013003: Properly create zero-initialized local memory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleaned up error message Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: base/metrics/persistent_memory_allocator.h
diff --git a/base/metrics/persistent_memory_allocator.h b/base/metrics/persistent_memory_allocator.h
index 56edd2ca24e0131d633b7aea805bd80e3681cb66..a6036689464e5c5116a411c2014127931284469f 100644
--- a/base/metrics/persistent_memory_allocator.h
+++ b/base/metrics/persistent_memory_allocator.h
@@ -354,6 +354,14 @@ class BASE_EXPORT LocalPersistentMemoryAllocator
~LocalPersistentMemoryAllocator() override;
private:
+ // Allocates a block of local memory of the specified |size|, ensuring that
+ // the memory will not be physically allocated until accessed and will read
+ // as zero when that happens.
+ static void* AllocateLocalMemory(size_t size);
+
+ // Deallocates a block of local |memory| of the specified |size|.
+ static void DeallocateLocalMemory(void* memory, size_t size);
+
DISALLOW_COPY_AND_ASSIGN(LocalPersistentMemoryAllocator);
};
« no previous file with comments | « no previous file | base/metrics/persistent_memory_allocator.cc » ('j') | base/metrics/persistent_memory_allocator.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698