Skip to content

Commit

Permalink
[ffi] Common C integer types (dart-archive/ffi#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcharkes authored Jan 20, 2022
1 parent 4ddb72c commit 7337e9e
Show file tree
Hide file tree
Showing 7 changed files with 560 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ffi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ jobs:
fail-fast: false
matrix:
# Add macos-latest and/or windows-latest if relevant for this package.
os: [ubuntu-latest]
sdk: [2.12.0, dev]
os: [macos-latest, ubuntu-latest, windows-latest]
sdk: [2.16.0-124.0.dev, dev] # TODO(dacoharkes): Set to 2.16.0 after SDK release.
steps:
- uses: actions/checkout@v2
- uses: dart-lang/[email protected]
Expand Down
8 changes: 8 additions & 0 deletions pkgs/ffi/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.2.0-dev.0

Added common C integer types as ABI-specific integers. These common C integer
types will make their way into `dart:ffi` in 2.17 and be deprecated from this
package. Having them in this package enables using them in Dart 2.16.

This pre-release requires Dart `2.16.0-118.0.dev` or greater.

## 1.1.2

Fixed unhandled exception in `withZoneArena` (#107).
Expand Down
1 change: 1 addition & 0 deletions pkgs/ffi/lib/ffi.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@

export 'src/allocation.dart' show calloc, malloc;
export 'src/arena.dart';
export 'src/c_type.dart';
export 'src/utf8.dart';
export 'src/utf16.dart';
4 changes: 0 additions & 4 deletions pkgs/ffi/lib/src/allocation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ class _MallocAllocator implements Allocator {
/// Throws an [ArgumentError] if the memory pointed to by [pointer] cannot be
/// freed.
///
// TODO(dartbug.com/36855): Once we have a ffi.Bool type we can use it instead
// of testing the return integer to be non-zero.
@override
void free(Pointer pointer) {
if (Platform.isWindows) {
Expand Down Expand Up @@ -151,8 +149,6 @@ class _CallocAllocator implements Allocator {
/// Throws an [ArgumentError] if the memory pointed to by [pointer] cannot be
/// freed.
///
// TODO(dartbug.com/36855): Once we have a ffi.Bool type we can use it instead
// of testing the return integer to be non-zero.
@override
void free(Pointer pointer) {
if (Platform.isWindows) {
Expand Down
Loading

0 comments on commit 7337e9e

Please sign in to comment.