Cache OBJ files in MuJoCo compiler.
PiperOrigin-RevId: 616211896 Change-Id: I3b765f4529957914e6154f0e62ef36fd9df93c96
This commit is contained in:
committed by
Copybara-Service
parent
bf66801bc9
commit
74d3d8cb4e
@@ -39,7 +39,8 @@ template<typename T> std::size_t mjCAsset::Add(const std::string& name,
|
||||
const uint8_t* ptr = reinterpret_cast<const uint8_t*>(data);
|
||||
mjCAssetData& block = it->second;
|
||||
|
||||
block.bytes = std::make_shared<uint8_t[]>(nbytes);
|
||||
block.bytes = std::shared_ptr<uint8_t>(new uint8_t[nbytes],
|
||||
[](uint8_t *p) {delete [] p;});
|
||||
std::copy(ptr, ptr + nbytes, block.bytes.get());
|
||||
block.nbytes = nbytes;
|
||||
nbytes_ += nbytes;
|
||||
|
||||
Reference in New Issue
Block a user