• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

dart-lang / native / 23990827319

02 Apr 2026 11:25AM UTC coverage: 60.157% (-1.1%) from 61.212%
23990827319

push

github

web-flow
[code_assets] [record_use] Tree shake examples (#3267)

Use the `CLinker` and `record_use` to tree-shake the native code in the code assets examples.

Tree shaking effect:

```
# stb_image
-rwxr-xr-x  1 dacoharkes  primarygroup   188K Mar 27 11:48 libstb_image.dylib
# when only using stbi_info
-rwxr-xr-x  1 dacoharkes  primarygroup   118K Mar 27 11:51 libstb_image.dylib

# mini_audio
# full
-rwxr-xr-x  1 dacoharkes  primarygroup   666K Mar 27 12:03 libminiaudio.dylib
# when playing a wave file
-rwxr-xr-x  1 dacoharkes  primarygroup   447K Mar 27 12:03 libminiaudio.dylib
# and when not playing the wave file but only starting the audio engine
-rwxr-xr-x  1 dacoharkes  primarygroup   429K Mar 27 12:05 libminiaudio.dylib

# sqlite3
# full
-rwxr-xr-x  1 dacoharkes  primarygroup   1.2M Mar 27 11:44 libsqlite3.dylib
# when only using sqlite3_libversion
-rwxr-xr-x  1 dacoharkes  primarygroup    50K Mar 27 11:44 libsqlite3.dylib
```

Since the record-use experiment is disabled by default in the Dart SDK, this should be mostly a no-op for the examples. It does change the native build into two steps, building and linking.

Potential follow ups to make the code simpler:

* https://github.com/dart-lang/native/issues/3283
* https://github.com/dart-lang/native/issues/3284

Also, we haven't added FFIgen to the workspace yet, but this PR requires having the latest version, so I've used a path override. We should clean that up when we can. (Either when we release a next FFIgen stable or when we move FFIgen to the workspace.)

18950 of 31501 relevant lines covered (60.16%)

35.64 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

96.26
/pkgs/ffigen/lib/src/code_generator/func.dart


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc