We have deserialized the raw Umbra Tome by our asset system so I’m thinking I should call Umbra::TomeLoader::loadFromBuffer(). Does this require extra memory or does it create the runtime Rome in the same memory space? (I assume it sorts out machine endian etc.)
TomeLoader::loadFromBuffer() will allocate a copy of the buffer (using the Allocator you give as an argument, or std::malloc() if there’s none), and do three things:
- Perform conversion (version upgrade) if the Tome has been computed using an older version of Umbra
- Swap the byte order if need be
- Align the returned Tome to 16 bytes
So if you know the loaded input buffer already satisfies these conditions, there’s actually no need to call loadFromBuffer() and you can just cast the buffer into a Tome pointer.