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
@@ -149,7 +149,7 @@ int mju_cholFactorSparse(mjtNum* mat, int n, mjtNum mindiag,
int rank = n;
mjMARKSTACK;
int* buf_ind = (int*) mj_stackAlloc(d, n);
int* buf_ind = mj_stackAllocInt(d, n);
mjtNum* sparse_buf = mj_stackAlloc(d, n);
// shrink rows so that rownnz ends at diagonal
@@ -255,7 +255,7 @@ int mju_cholUpdateSparse(mjtNum* mat, mjtNum* x, int n, int flg_plus,
int* rownnz, int* rowadr, int* colind, int x_nnz, int* x_ind,
mjData* d) {
mjMARKSTACK;
int* buf_ind = (int*) mj_stackAlloc(d, n);
int* buf_ind = mj_stackAllocInt(d, n);
mjtNum* sparse_buf = mj_stackAlloc(d, n);
// backpass over rows corresponding to non-zero x(r)