dart-lang / dart-lang/native

Test that NativeFinalizer is actually invoked.

Open
#635 4 comments 0 reactions 0 assignees View on GitHub
package:jni package:jnigen type-test
Dominant language
Dart
Stars
275
Forks
144
Avg merge
2d 10h
Merged PRs (30d)
47

Description

This was originally a checkbox under dart-lang/native#669 . But I think this deserves separate issue.

Have to verify the `NativeFinalizer` is actually invoked when GC is invoked.

We should either
* Mock the finalizer in this test
* How?
* Associate an atomic counter or keep some other metric in `dartjni.so`

[https://github.com/dart-lang/ffigen/blob/master/test/native_objc_test/automated_ref_count_test.dart](this) is the test Liam mentioned in a previous discussion but I don't think this counter-decrease-on-delete pattern is applicable in Java.

* On Android, `Dart_ExecuteInternalCommand` symbol does not exist
* Is there another way to trigger GC on Android?

cc:
@liamappelbe
@dcharkes

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.