On Fri, Feb 5, 2021 at 7:00 AM Sebastien Binet <s...@sbinet.org> wrote:

> but as I wrote in the OP, it's not completely satisfying.
> one needs to keep track of the association font.Face/[]byte.
> so that's either double the memory (give or take), or a filename/io.Reader
> handle to keep around.
>

Two []byte values aren't double the memory if the slices share the same
backing array.

If you're passing a file-backed io.ReaderAt to sfnt.ParseReaderAt, you're
going to have to keep the file open anyway, and having multiple references
to the same io.ReaderAt similarly all share the same file descriptor.
You're probably also going to have to track the underlying *os.File
separately anyway, in order to Close it when you're done (or else you'd
leak it).

What's your proposed API?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOeFMNVgDT%2Bs%2BkqpehmeShhK%3DHB5GhpMCOJrWiqveBKDeJNS5g%40mail.gmail.com.

Reply via email to