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

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

Issue 3000623002: [kernel] Free memory for kernel data. (Closed)
Patch Set: Remove commented out code Created 3 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
« runtime/vm/dart_api_impl.cc ('K') | « runtime/vm/dart_api_impl.cc ('k') | 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 (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 RUNTIME_VM_KERNEL_H_ 5 #ifndef RUNTIME_VM_KERNEL_H_
6 #define RUNTIME_VM_KERNEL_H_ 6 #define RUNTIME_VM_KERNEL_H_
7 7
8 #if !defined(DART_PRECOMPILED_RUNTIME) 8 #if !defined(DART_PRECOMPILED_RUNTIME)
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "vm/allocation.h" 10 #include "vm/allocation.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 }; 109 };
110 }; 110 };
111 111
112 class LogicalExpression { 112 class LogicalExpression {
113 public: 113 public:
114 enum Operator { kAnd, kOr }; 114 enum Operator { kAnd, kOr };
115 }; 115 };
116 116
117 class Program { 117 class Program {
118 public: 118 public:
119 ~Program() {
120 if (kernel_data_ != NULL) {
Kevin Millikin (Google) 2017/08/14 06:20:50 free checks for null. It's clunky to check here,
jensj 2017/08/14 08:38:12 Done.
121 free(const_cast<uint8_t*>(kernel_data_));
122 kernel_data_ = NULL;
123 }
124 }
125
119 static Program* ReadFrom(Reader* reader); 126 static Program* ReadFrom(Reader* reader);
120 127
121 NameIndex main_method() { return main_method_reference_; } 128 NameIndex main_method() { return main_method_reference_; }
122 intptr_t string_table_offset() { return string_table_offset_; } 129 intptr_t string_table_offset() { return string_table_offset_; }
123 intptr_t name_table_offset() { return name_table_offset_; } 130 intptr_t name_table_offset() { return name_table_offset_; }
124 const uint8_t* kernel_data() { return kernel_data_; } 131 const uint8_t* kernel_data() { return kernel_data_; }
125 intptr_t kernel_data_size() { return kernel_data_size_; } 132 intptr_t kernel_data_size() { return kernel_data_size_; }
126 intptr_t library_count() { return library_count_; } 133 intptr_t library_count() { return library_count_; }
127 134
128 private: 135 private:
(...skipping 19 matching lines...) Expand all
148 155
149 } // namespace kernel 156 } // namespace kernel
150 157
151 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, 158 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer,
152 intptr_t buffer_length); 159 intptr_t buffer_length);
153 160
154 } // namespace dart 161 } // namespace dart
155 162
156 #endif // !defined(DART_PRECOMPILED_RUNTIME) 163 #endif // !defined(DART_PRECOMPILED_RUNTIME)
157 #endif // RUNTIME_VM_KERNEL_H_ 164 #endif // RUNTIME_VM_KERNEL_H_
OLDNEW
« runtime/vm/dart_api_impl.cc ('K') | « runtime/vm/dart_api_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698