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

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

Issue 9209001: Move utils.h and utils.cc from runtime/vm to runtime/platform (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addresed new comments from ager@ Created 8 years, 11 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/bigint_operations.cc ('k') | runtime/vm/dart_api_impl_test.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) 2011, 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_BIGINT_STORE_H_ 5 #ifndef VM_BIGINT_STORE_H_
6 #define VM_BIGINT_STORE_H_ 6 #define VM_BIGINT_STORE_H_
7 7
8 #include "vm/globals.h" 8 #include "vm/globals.h"
9 #include "vm/isolate.h"
9 10
10 namespace dart { 11 namespace dart {
11 12
12 // Use to store teporary BIGNUMs. 13 // Use to store teporary BIGNUMs.
13 class BigintStore { 14 class BigintStore {
14 public: 15 public:
15 BigintStore() : bn_(NULL), bn_ctx_(NULL) {} 16 BigintStore() : bn_(NULL), bn_ctx_(NULL) {}
16 ~BigintStore() { 17 ~BigintStore() {
17 BN_free(bn_); 18 BN_free(bn_);
18 BN_CTX_free(bn_ctx_); 19 BN_CTX_free(bn_ctx_);
19 } 20 }
20 21
21 static BigintStore* Get() { 22 static BigintStore* Get() {
22 BigintStore* store = Isolate::Current()->bigint_store(); 23 BigintStore* store = Isolate::Current()->bigint_store();
23 if (store == NULL) { 24 if (store == NULL) {
24 store = new BigintStore(); 25 store = new BigintStore();
25 Isolate::Current()->set_bigint_store(store); 26 Isolate::Current()->set_bigint_store(store);
26 } 27 }
27 return store; 28 return store;
28 } 29 }
29 30
30 BIGNUM* bn_; 31 BIGNUM* bn_;
31 BN_CTX* bn_ctx_; 32 BN_CTX* bn_ctx_;
32 }; 33 };
33 34
34 } // namespace dart 35 } // namespace dart
35 36
36 #endif // VM_BIGINT_STORE_H_ 37 #endif // VM_BIGINT_STORE_H_
OLDNEW
« no previous file with comments | « runtime/vm/bigint_operations.cc ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698