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

Side by Side Diff: src/vm/list.h

Issue 1209033003: Work in progres, please take a look and give early feedback if this is the way we want to structure… (Closed) Base URL: git@github.com:dart-lang/fletch.git@master
Patch Set: address comments Created 5 years, 5 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 | « src/vm/ffi_test_library.c ('k') | src/vm/object.h » ('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) 2014, the Fletch project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Fletch 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.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 #ifndef SRC_VM_LIST_H_ 5 #ifndef SRC_VM_LIST_H_
6 #define SRC_VM_LIST_H_ 6 #define SRC_VM_LIST_H_
7 7
8 #include <stdlib.h> 8 #include <stdlib.h>
9 #include <string.h> 9 #include <string.h>
10 #include "src/shared/assert.h" 10 #include "src/shared/assert.h"
11 11
12 namespace fletch { 12 namespace fletch {
13 13
14 // Lists are light-weight data structures that hold a sequence of 14 // Lists are light-weight data structures that hold a sequence of
15 // contiguous elements. List never take ownership of the data their 15 // contiguous elements. List never take ownership of the data they
16 // are passed in, so as long as the data is either in a zone or 16 // are passed in, so as long as the data is either in a zone or
17 // static, lists can be safely passed by value. 17 // static, lists can be safely passed by value.
18 template<typename T> 18 template<typename T>
19 class List { 19 class List {
20 public: 20 public:
21 List() : data_(NULL), length_(0) { } 21 List() : data_(NULL), length_(0) { }
22 22
23 List(T* data, int length) : data_(data), length_(length) { 23 List(T* data, int length) : data_(data), length_(length) {
24 ASSERT(length >= 0); 24 ASSERT(length >= 0);
25 } 25 }
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 } 66 }
67 67
68 private: 68 private:
69 T* data_; 69 T* data_;
70 int length_; 70 int length_;
71 }; 71 };
72 72
73 } // namespace fletch 73 } // namespace fletch
74 74
75 #endif // SRC_VM_LIST_H_ 75 #endif // SRC_VM_LIST_H_
OLDNEW
« no previous file with comments | « src/vm/ffi_test_library.c ('k') | src/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698