[squeak-dev] FFI: FFI-Kernel-mt.113.mcz

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Thu Jun 18 13:00:26 UTC 2020


ignored length does make me think of it...
IMO, we should manipulate bounded pointers when possible.
That is, address + byteLength.
Most of the time, we know the length (when we allocated ourselves, when we
have a pointer to scalar, etc...).

Le jeu. 18 juin 2020 à 14:45, <commits at source.squeak.org> a écrit :

> Marcel Taeumel uploaded a new version of FFI-Kernel to project FFI:
> http://source.squeak.org/FFI/FFI-Kernel-mt.113.mcz
>
> ==================== Summary ====================
>
> Name: FFI-Kernel-mt.113
> Author: mt
> Time: 18 June 2020, 2:40:14.824118 pm
> UUID: 556bf79d-15a2-f340-9586-a0333f091288
> Ancestors: FFI-Kernel-mt.112
>
> Avoid copying external structs that are part of other structs from
> external memory into object memory.
>
> =============== Diff against FFI-Kernel-mt.112 ===============
>
> Item was added:
> + ----- Method: ExternalAddress>>structAt:length: (in category
> 'accessing') -----
> + structAt: byteOffset length: length
> +       "Return the external address of the struct's first field. Ignore
> length."
> +       ^ self + byteOffset!
>
> Item was added:
> + ----- Method: ExternalAddress>>structAt:put:length: (in category
> 'accessing') -----
> + structAt: byteOffset put: externalAddress length: length
> +       "Read length bytes from externalAddress and write it at this
> external address (plus byteOffset)."
> +
> +       | start |
> +       start := self + byteOffset.
> +       1 to: length do: [:targetOffset |
> +               start
> +                       byteAt: targetOffset
> +                       put: (externalAddress byteAt: targetOffset)].!
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200618/bbe0956b/attachment.html>


More information about the Squeak-dev mailing list