The ffi function wrapper need to be changed because in the 2021 edition, when
the capture is moved into the closure, it moves the individual field instead
of the whole wrapper. But we need to move the whole wrapper because the Drop
of the wrapper will delete the C++ closure, and we don't want to call the
closure after it is deleted.
Use the reuse tool to get a better grip on licenses used in sixtyfps.
Fix a couple of licenses along the way.
* Uses creative commons for our own logo (commercial use!)
* Fixes some license information found in README files and documents
them with proper .license files.
* Document Apache/MIT for helper_crates/const-field-offset which matches
what its documentaion site says it uses.
* Add a list of licenses that apply to crates we publish and the tooling
we have.
This patch only adds static information and does not contain any tooling
support.
* fixed typo in image.rs
* unnecessary repeated words in sixtyfps_runtime
* unnecessary repeated words in sixtyfps_compiler
* unnecessary repeated word in docs
* unnecessary repeated words in helper_crates
For now this requires pinning on the type contained in VRc as well as
the fields mapped to. This could be lifted using additional flags, but
for now this is what we need anyway.
As outlined in commit 753ec83a05,
converting from a VRc<VT, X> to VRc<VT, Dyn> requires subsequent use of
the data_offset in order to determine the correct instance pointer.
This applies also to VRc's Deref implementation, which isn't used with
Dyn right now, but will be soon in order to determine the bare instance
address for item tree traversal.
Component's get_item_ref has a life time attached to it, and in the
interpreter we're having two vtable implementations, one for
ErasedComponentBox and another generated one. The approach with
as_pin_ref to transfer the lifetime to a reference to the trait object
for the other vtable isn't working because as_pin_ref consumes the VRef
and then takes the address of a temporary on the stack.
Short of a cleaner solution, this patch circumvents the second vtable
indirection and calls our extern "C" function directly.
When converting a Weak<VT, T> into Weak<VT, Dyn>, we were ignoring that
while T inside VRcInner may be at a certain offset to satisfy alignment,
the empty Dyn field may not and thus be at a different offset.
On wasm32 for example the compiler generated component struct has a
16-byte alignment, while the Dyn has none. So converting the Weak<VT,
Dyn> to a VRc<VT, Dyn> and then calling borrow() would use the wrong
instance pointer.
To fix this, this patch introduces an extra offset field that's
preserved during the casting and that's used for borrow() as well as
drop().