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); |