[gardening] Fix test
TEST=tests/ffi/deeply_immutable_c_api_finalizer_test.dart Closes: https://github.com/dart-lang/sdk/issues/55165 Change-Id: I8e5925b978db4591442ca36d57a6a98f85501bbd Cq-Include-Trybots: luci.dart.try:vm-win-debug-x64-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/356801 Reviewed-by: Ben Konyi <bkonyi@google.com> Commit-Queue: Daco Harkes <dacoharkes@google.com>
This commit is contained in:
committed by
Commit Queue
parent
dfe0457f84
commit
e7daade291
@@ -617,6 +617,10 @@ DART_EXPORT void ExecuteCallback(Work* work_ptr) {
|
||||
|
||||
Dart_Port send_port_;
|
||||
|
||||
DART_EXPORT void* Calloc(size_t count, size_t size) {
|
||||
return calloc(count, size);
|
||||
}
|
||||
|
||||
DART_EXPORT void FreeFinalizer(void*, void* value) {
|
||||
free(value);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ final class MyFinalizable implements Finalizable {
|
||||
MyFinalizable._(this.pointer);
|
||||
|
||||
factory MyFinalizable() {
|
||||
final pointer = calloc<Int>(10);
|
||||
final pointer = calloc(sizeOf<Int>(), 10).cast<Int>();
|
||||
pointer.value = 123;
|
||||
final result = MyFinalizable._(pointer);
|
||||
newFinalizableHandle(
|
||||
@@ -41,6 +41,10 @@ final class MyFinalizable implements Finalizable {
|
||||
}
|
||||
}
|
||||
|
||||
final calloc = dlopenPlatformSpecific("ffi_test_functions")
|
||||
.lookup<NativeFunction<Pointer<Void> Function(Size, Size)>>('Calloc')
|
||||
.asFunction<Pointer<Void> Function(int, int)>();
|
||||
|
||||
final freeFinalizer = dlopenPlatformSpecific("ffi_test_functions")
|
||||
.lookup<NativeFunction<Dart_HandleFinalizerFunction>>('FreeFinalizer');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user