Refactor stack allocations to have a clean byte allocation interface.

PiperOrigin-RevId: 558881470
Change-Id: I08c45cb5fa25a1a9c39560e598e805cfa5141c3e
This commit is contained in:
Matthew Bennice
2023-08-21 13:17:48 -07:00
committed by Copybara-Service
parent 22fd0586b1
commit 59138af10b
10 changed files with 67 additions and 64 deletions
+2 -2
View File
@@ -69,14 +69,14 @@ static void set0(mjModel* m, mjData* d) {
// save camera and light mode, set to fixed
if (m->ncam) {
cammode = (int*) mj_stackAlloc(d, m->ncam);
cammode = mj_stackAllocInt(d, m->ncam);
for (int i=0; i < m->ncam; i++) {
cammode[i] = m->cam_mode[i];
m->cam_mode[i] = mjCAMLIGHT_FIXED;
}
}
if (m->nlight) {
lightmode = (int*) mj_stackAlloc(d, m->nlight);
lightmode = mj_stackAllocInt(d, m->nlight);
for (int i=0; i < m->nlight; i++) {
lightmode[i] = m->light_mode[i];
m->light_mode[i] = mjCAMLIGHT_FIXED;