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

Side by Side Diff: runtime/vm/code_observers.cc

Issue 16378004: Revert change 23636 as it is causing issues on dartium. Will resubmit after investigating the darti… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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
« no previous file with comments | « runtime/vm/class_table.cc ('k') | runtime/vm/dart_api_impl.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 #include "vm/code_observers.h" 5 #include "vm/code_observers.h"
6 6
7 #include "platform/utils.h"
8 #include "vm/os.h" 7 #include "vm/os.h"
9 8
10 namespace dart { 9 namespace dart {
11 10
12 intptr_t CodeObservers::observers_length_ = 0; 11 intptr_t CodeObservers::observers_length_ = 0;
13 CodeObserver** CodeObservers::observers_ = NULL; 12 CodeObserver** CodeObservers::observers_ = NULL;
14 13
15 14
16 void CodeObservers::Register(CodeObserver* observer) { 15 void CodeObservers::Register(CodeObserver* observer) {
17 intptr_t new_length = observers_length_ + 1; 16 observers_length_++;
18 observers_ = Utils::Realloc(observers_, observers_length_, new_length); 17 observers_ = reinterpret_cast<CodeObserver**>(
18 realloc(observers_, sizeof(observer) * observers_length_));
19 if (observers_ == NULL) { 19 if (observers_ == NULL) {
20 FATAL("failed to grow code observers array"); 20 FATAL("failed to grow code observers array");
21 } 21 }
22 observers_length_ = new_length;
23 observers_[observers_length_ - 1] = observer; 22 observers_[observers_length_ - 1] = observer;
24 } 23 }
25 24
26 25
27 void CodeObservers::NotifyAll(const char* name, 26 void CodeObservers::NotifyAll(const char* name,
28 uword base, 27 uword base,
29 uword prologue_offset, 28 uword prologue_offset,
30 uword size, 29 uword size,
31 bool optimized) { 30 bool optimized) {
32 ASSERT(!AreActive() || (strlen(name) != 0)); 31 ASSERT(!AreActive() || (strlen(name) != 0));
(...skipping 20 matching lines...) Expand all
53 free(observers_); 52 free(observers_);
54 } 53 }
55 54
56 55
57 void CodeObservers::InitOnce() { 56 void CodeObservers::InitOnce() {
58 OS::RegisterCodeObservers(); 57 OS::RegisterCodeObservers();
59 } 58 }
60 59
61 60
62 } // namespace dart 61 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/class_table.cc ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698