Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions shell/platform/fuchsia/dart-pkg/zircon/sdk_ext/system.cc
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,7 @@ struct SizedRegion {
size_t size;
};

void System::VmoMapFinalizer(void* isolate_callback_data,
Dart_WeakPersistentHandle handle,
void* peer) {
void System::VmoMapFinalizer(void* isolate_callback_data, void* peer) {
SizedRegion* r = reinterpret_cast<SizedRegion*>(peer);
zx_vmar_unmap(zx_vmar_root_self(), reinterpret_cast<uintptr_t>(r->region),
r->size);
Expand Down Expand Up @@ -453,9 +451,9 @@ Dart_Handle System::VmoMap(fml::RefPtr<Handle> vmo) {
FML_DCHECK(!tonic::LogIfError(object));

SizedRegion* r = new SizedRegion(data, size);
Dart_NewWeakPersistentHandle(object, reinterpret_cast<void*>(r),
static_cast<intptr_t>(size) + sizeof(*r),
System::VmoMapFinalizer);
Dart_NewFinalizableHandle(object, reinterpret_cast<void*>(r),
static_cast<intptr_t>(size) + sizeof(*r),
System::VmoMapFinalizer);

return ConstructDartObject(kMapResult, ToDart(ZX_OK), object);
}
Expand Down
4 changes: 1 addition & 3 deletions shell/platform/fuchsia/dart-pkg/zircon/sdk_ext/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ class System : public fml::RefCountedThreadSafe<System>,
fml::RefPtr<Handle> channel);

private:
static void VmoMapFinalizer(void* isolate_callback_data,
Dart_WeakPersistentHandle handle,
void* peer);
static void VmoMapFinalizer(void* isolate_callback_data, void* peer);

static zx::channel CloneChannelFromFileDescriptor(int fd);
};
Expand Down
6 changes: 2 additions & 4 deletions third_party/tonic/file_loader/file_loader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,7 @@ Dart_Handle FileLoader::Import(Dart_Handle url) {
}

namespace {
void MallocFinalizer(void* isolate_callback_data,
Dart_WeakPersistentHandle handle,
void* peer) {
void MallocFinalizer(void* isolate_callback_data, void* peer) {
free(peer);
}
} // namespace
Expand All @@ -212,7 +210,7 @@ Dart_Handle FileLoader::Kernel(Dart_Handle url) {
}
result =
Dart_NewExternalTypedData(Dart_TypedData_kUint8, buffer, buffer_size);
Dart_NewWeakPersistentHandle(result, buffer, buffer_size, MallocFinalizer);
Dart_NewFinalizableHandle(result, buffer, buffer_size, MallocFinalizer);
return result;
}

Expand Down