| OLD | NEW |
| 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 library system; | 5 library system; |
| 6 | 6 |
| 7 import 'dart:ffi'; | 7 import 'dart:ffi'; |
| 8 import 'dart:io'; | 8 import 'dart:io'; |
| 9 import 'dart:typed_data'; | 9 import 'dart:typed_data'; |
| 10 | 10 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 int setBlocking(int fd, bool blocking); | 81 int setBlocking(int fd, bool blocking); |
| 82 int setReuseaddr(int fd); | 82 int setReuseaddr(int fd); |
| 83 | 83 |
| 84 static int eventHandler = _getEventHandler(); | 84 static int eventHandler = _getEventHandler(); |
| 85 @fletch.native external static int _getEventHandler(); | 85 @fletch.native external static int _getEventHandler(); |
| 86 @fletch.native external static int _incrementPortRef(Port port); | 86 @fletch.native external static int _incrementPortRef(Port port); |
| 87 } | 87 } |
| 88 | 88 |
| 89 final int hostWordSize = Foreign.bitsPerMachineWord ~/ 8; | 89 final int hostWordSize = Foreign.bitsPerMachineWord ~/ 8; |
| 90 | 90 |
| 91 class Struct extends Foreign { | 91 class Struct extends ForeignMemory { |
| 92 final wordSize; | 92 final wordSize; |
| 93 | 93 |
| 94 Struct(int fields) | 94 Struct(int fields) |
| 95 : this.wordSize = hostWordSize, | 95 : this.wordSize = hostWordSize, |
| 96 super.allocated(fields * hostWordSize); | 96 super.allocated(fields * hostWordSize); |
| 97 | 97 |
| 98 Struct.finalize(int fields) | 98 Struct.finalize(int fields) |
| 99 : this.wordSize = hostWordSize, | 99 : this.wordSize = hostWordSize, |
| 100 super.allocatedFinalize(fields * hostWordSize); | 100 super.allocatedFinalize(fields * hostWordSize); |
| 101 | 101 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 | 140 |
| 141 class Struct64 extends Struct { | 141 class Struct64 extends Struct { |
| 142 Struct64(int fields) : super.withWordSize(fields, 8); | 142 Struct64(int fields) : super.withWordSize(fields, 8); |
| 143 Struct64.finalize(int fields) : super.withWordSizeFinalize(fields, 8); | 143 Struct64.finalize(int fields) : super.withWordSizeFinalize(fields, 8); |
| 144 } | 144 } |
| 145 | 145 |
| 146 class _InternetAddress extends InternetAddress { | 146 class _InternetAddress extends InternetAddress { |
| 147 final List<int> _bytes; | 147 final List<int> _bytes; |
| 148 _InternetAddress(this._bytes); | 148 _InternetAddress(this._bytes); |
| 149 } | 149 } |
| OLD | NEW |