how to copy binbufs?

Olaf Matthes's icon

In order to pass the content of a binbuf on from a child thread to Max's
main thread (using defer_low()) I'd need to make a copy of a binbuf. Is
there an easy way to do that? Since I don't know the size of the binbuf
something like sysmem_newptr() does not work... I could extract the
content from the binbuf and then just make a new one, but maybe there is
a more elegant solution?

Olaf