Custom memory allocation when integrating OpenUsd

Hello all,

I noticed several (games ) teams that are interested in integrating OpenUsd in their own pipeline end up writing complicated wrappers to isolate OpenUsd from the main code as much as possible because of the memory allocations.

I am currently running into this again as well, from our technical director:

OpenUsd returns std:: contaniners (std::vector) that are allocated inside the OpenUSD dll and we crash when we try to free them with our allocator

Before we embark on the same journey to isolate usd, I thought I’d ask here if anyone has any advice to make this easier.

Thanks,

Koen

Hi @koen , I think Request to use raw operator new/delete instead of malloc/free · Issue #1712 · PixarAnimationStudios/OpenUSD · GitHub reflects the state-of-the-world in 2022, and we have not, regrettably, made time to look into it. Does the request to replace our use of malloc/free with raw new/delete for boundary-crossing allocations still seem like a sufficient path forward?

Hello Spiff,

As always, thanks very much for your reply.

I’m not familiar enough with the details to know if this would solve it. I will read the github issue, follow up with the engineers here and will keep you posted.

cheers,

koen