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

Side by Side Diff: src/global-handles.h

Issue 6813101: Fix retained object info leak. (Closed)
Patch Set: Fix typo Created 9 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | 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 // Copyright 2007-2008 the V8 project authors. All rights reserved. 1 // Copyright 2007-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 ASSERT(length > 0); 50 ASSERT(length > 0);
51 ObjectGroup* group = reinterpret_cast<ObjectGroup*>( 51 ObjectGroup* group = reinterpret_cast<ObjectGroup*>(
52 malloc(OFFSET_OF(ObjectGroup, objects_[length]))); 52 malloc(OFFSET_OF(ObjectGroup, objects_[length])));
53 group->length_ = length; 53 group->length_ = length;
54 group->info_ = info; 54 group->info_ = info;
55 CopyWords(group->objects_, handles, static_cast<int>(length)); 55 CopyWords(group->objects_, handles, static_cast<int>(length));
56 return group; 56 return group;
57 } 57 }
58 58
59 void Dispose() { 59 void Dispose() {
60 if (info_ != NULL) info_->Dispose();
60 free(this); 61 free(this);
61 } 62 }
62 63
63 size_t length_; 64 size_t length_;
64 v8::RetainedObjectInfo* info_; 65 v8::RetainedObjectInfo* info_;
65 Object** objects_[1]; // Variable sized array. 66 Object** objects_[1]; // Variable sized array.
66 67
67 private: 68 private:
68 void* operator new(size_t size); 69 void* operator new(size_t size);
69 void operator delete(void* p); 70 void operator delete(void* p);
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 260
260 friend class Isolate; 261 friend class Isolate;
261 262
262 DISALLOW_COPY_AND_ASSIGN(GlobalHandles); 263 DISALLOW_COPY_AND_ASSIGN(GlobalHandles);
263 }; 264 };
264 265
265 266
266 } } // namespace v8::internal 267 } } // namespace v8::internal
267 268
268 #endif // V8_GLOBAL_HANDLES_H_ 269 #endif // V8_GLOBAL_HANDLES_H_
OLDNEW
« 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