googlefonts / oxidize

Notes on moving tools and libraries to Rust.
Apache License 2.0
173 stars 7 forks source link

Add definition of zerocopy #6

Closed dfrg closed 2 years ago

dfrg commented 2 years ago

This adds a new Definitions section to the README along with a proposed definition for zerocopy. I believe this accurately represents the result of the relevant discussion from the font-types PR and the associated issue.

dfrg commented 2 years ago

I think the discussion here is interesting and useful but not particularly germane to the PR. I propose to narrow the definition to:

zerocopy

The direct reading/writing of scalars and, wherever possible, aggregates (structs and slices) through reinterpretation of pointers to raw bytes in memory.

… and move the implementation strategy discussion to an issue so we can continue there.

rsheeter commented 2 years ago

+1 to the refined definition, I think that's a much more direct assertion of "zerocopy means X"

EDIT: I'm +1 to merge with that version. If we want to capture the graph traversal aspect that's fine but maybe in a subsequent PR.