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

Unified Diff: courgette/memory_allocator.cc

Issue 10826014: Add a clarifying comment to the memory layout navigation. (Inspired by Coverity CID 100022) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: courgette/memory_allocator.cc
diff --git a/courgette/memory_allocator.cc b/courgette/memory_allocator.cc
index f2aed22d589296a8f983f062f95c99b0009bdd40..97f99b9f9486faac572a9fd06b22dfdd406ff8ab 100644
--- a/courgette/memory_allocator.cc
+++ b/courgette/memory_allocator.cc
@@ -135,6 +135,8 @@ bool TempMapping::Initialize(size_t size) {
void* TempMapping::memory() const {
uint8* mem = reinterpret_cast<uint8*>(mapping_.view());
+ // The 'this' pointer is written at the start of mapping_.view, so
+ // go past it. (See Initialize()).
tommi (sloooow) - chröme 2012/07/25 19:04:05 Ah, nice! That's not at all clear from the code.
Greg Billock 2012/07/25 20:12:04 Done.
if (mem)
mem += sizeof(this);
DCHECK(mem);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698