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

Side by Side Diff: runtime/vm/freelist.h

Issue 10452006: Implement a heap profiler for the Dart managed heap. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: added basic test code Created 8 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_FREELIST_H_ 5 #ifndef VM_FREELIST_H_
6 #define VM_FREELIST_H_ 6 #define VM_FREELIST_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/allocation.h" 9 #include "vm/allocation.h"
10 #include "vm/raw_object.h" 10 #include "vm/raw_object.h"
(...skipping 24 matching lines...) Expand all
35 intptr_t Size() const { 35 intptr_t Size() const {
36 if (class_ == minimal_element_class_) { 36 if (class_ == minimal_element_class_) {
37 return kObjectAlignment; 37 return kObjectAlignment;
38 } 38 }
39 ASSERT(class_ == element_class_); 39 ASSERT(class_ == element_class_);
40 return *SizeAddress(); 40 return *SizeAddress();
41 } 41 }
42 42
43 static FreeListElement* AsElement(uword addr, intptr_t size); 43 static FreeListElement* AsElement(uword addr, intptr_t size);
44 44
45 static bool IsSpecialClass(RawObject* raw_obj) { 45 static bool IsSpecialClass(const RawObject* raw_obj) {
46 return (raw_obj == minimal_element_class_) || (raw_obj == element_class_); 46 return (raw_obj == minimal_element_class_) || (raw_obj == element_class_);
47 } 47 }
48 48
49 static void InitOnce(); 49 static void InitOnce();
50 50
51 private: 51 private:
52 // This layout mirrors the layout of RawObject. 52 // This layout mirrors the layout of RawObject.
53 RawClass* class_; 53 RawClass* class_;
54 uword next_; 54 uword next_;
55 55
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 void SplitElementAfterAndEnqueue(FreeListElement* element, intptr_t size); 98 void SplitElementAfterAndEnqueue(FreeListElement* element, intptr_t size);
99 99
100 FreeListElement* free_lists_[kNumLists + 1]; 100 FreeListElement* free_lists_[kNumLists + 1];
101 101
102 DISALLOW_COPY_AND_ASSIGN(FreeList); 102 DISALLOW_COPY_AND_ASSIGN(FreeList);
103 }; 103 };
104 104
105 } // namespace dart 105 } // namespace dart
106 106
107 #endif // VM_FREELIST_H_ 107 #endif // VM_FREELIST_H_
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/heap.h » ('j') | runtime/vm/heap_profiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698