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

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

Issue 1309603003: Fix reuse of free blocks and delete global cache on VM shutdown. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Commit. Created 5 years, 4 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 | « runtime/vm/dart.cc ('k') | runtime/vm/store_buffer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_STORE_BUFFER_H_ 5 #ifndef VM_STORE_BUFFER_H_
6 #define VM_STORE_BUFFER_H_ 6 #define VM_STORE_BUFFER_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 10
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 72
73 DISALLOW_COPY_AND_ASSIGN(StoreBufferBlock); 73 DISALLOW_COPY_AND_ASSIGN(StoreBufferBlock);
74 }; 74 };
75 75
76 76
77 class StoreBuffer { 77 class StoreBuffer {
78 public: 78 public:
79 StoreBuffer(); 79 StoreBuffer();
80 ~StoreBuffer(); 80 ~StoreBuffer();
81 static void InitOnce(); 81 static void InitOnce();
82 static void ShutDown();
82 83
83 // Interrupt when crossing this threshold of non-empty blocks in the buffer. 84 // Interrupt when crossing this threshold of non-empty blocks in the buffer.
84 static const intptr_t kMaxNonEmpty = 100; 85 static const intptr_t kMaxNonEmpty = 100;
85 86
86 // Adds and transfers ownership of the block to the buffer. 87 // Adds and transfers ownership of the block to the buffer.
87 void PushBlock(StoreBufferBlock* block, bool check_threshold = true); 88 void PushBlock(StoreBufferBlock* block, bool check_threshold = true);
88 // Partially filled blocks can be reused, and there is an "inifite" supply 89 // Partially filled blocks can be reused, and there is an "inifite" supply
89 // of empty blocks (reused or newly allocated). In any case, the caller 90 // of empty blocks (reused or newly allocated). In any case, the caller
90 // takes ownership of the returned block. 91 // takes ownership of the returned block.
91 StoreBufferBlock* PopNonFullBlock(); 92 StoreBufferBlock* PopNonFullBlock();
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 static const intptr_t kMaxGlobalEmpty = 100; 130 static const intptr_t kMaxGlobalEmpty = 100;
130 static List* global_empty_; 131 static List* global_empty_;
131 static Mutex* global_mutex_; 132 static Mutex* global_mutex_;
132 133
133 DISALLOW_COPY_AND_ASSIGN(StoreBuffer); 134 DISALLOW_COPY_AND_ASSIGN(StoreBuffer);
134 }; 135 };
135 136
136 } // namespace dart 137 } // namespace dart
137 138
138 #endif // VM_STORE_BUFFER_H_ 139 #endif // VM_STORE_BUFFER_H_
OLDNEW
« no previous file with comments | « runtime/vm/dart.cc ('k') | runtime/vm/store_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698