Skip to content

Conversation

@josxha
Copy link

@josxha josxha commented Nov 8, 2025

This PR turns the Arena parameter in the using computation function into a named parameter.

While working with the using-pattern, I wished for this tiny quality of life improvement.
I didn't update the changelog since it's such a small change - can add it if wanted.

Before After
without with

  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Contribution guidelines:

Many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.

Note: The Dart team is trialing Gemini Code Assist. Don't take its comments as final Dart team feedback. Use the suggestions if they're helpful; otherwise, wait for a human reviewer.

@josxha josxha changed the title [ffi] named Arena parameter in using() [ffi] named Arena parameter in using() function Nov 8, 2025
@dcharkes
Copy link
Collaborator

Nice!

Please also bump the patch version and add a changelog entry so I can hit the release button. 🚀

@github-actions
Copy link

PR Health

License Headers ✔️
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
Files
no missing headers

All source files should start with a license header.

Unrelated files missing license headers
Files
pkgs/objective_c/lib/src/ns_input_stream.dart

This check can be disabled by tagging the PR with skip-license-check.

API leaks ⚠️

The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.

Package Leaked API symbol Leaking sources
ffi MallocAllocator allocation.dart::malloc
ffi CallocAllocator allocation.dart::calloc

This check can be disabled by tagging the PR with skip-leaking-check.

Breaking changes ✔️
Package Change Current Version New Version Needed Version Looking good?
ffi None 2.1.4 2.1.5-wip 2.1.4 ✔️

This check can be disabled by tagging the PR with skip-breaking-check.

Changelog Entry
Package Changed Files
package:ffi pkgs/ffi/lib/src/arena.dart

Changes to files need to be accounted for in their respective changelogs.

This check can be disabled by tagging the PR with skip-changelog-check.

@josxha
Copy link
Author

josxha commented Nov 11, 2025

Thanks for your feedback @dcharkes!

  • added another parameter name for the releaseCallback(T) in arena.using(). I used res instead of resource for that parameter name because I assume that most implementations of this callback will be one liners.
  • bumped the version to 2.1.5
  • added changelog entry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants