Rename nstack to narena, change it and pstack to count bytes.
PiperOrigin-RevId: 561066311 Change-Id: I4d0e645e6c254dd906bfc42159e0e99149a7c6c8
This commit is contained in:
committed by
Copybara-Service
parent
b979a26b10
commit
daa2ac7f8b
@@ -151,8 +151,8 @@ typedef struct mjSolverStat_ mjSolverStat;
|
||||
|
||||
struct mjData_ {
|
||||
// constant sizes
|
||||
int nstack; // number of mjtNums that can fit in the arena+stack space
|
||||
int nbuffer; // size of main buffer in bytes
|
||||
size_t narena; // size of the arena in bytes (inclusive of the stack)
|
||||
size_t nbuffer; // size of main buffer in bytes
|
||||
int nplugin; // number of plugin instances
|
||||
|
||||
// stack pointer
|
||||
@@ -162,7 +162,7 @@ struct mjData_ {
|
||||
size_t parena; // first available byte in arena
|
||||
|
||||
// memory utilization stats
|
||||
int maxuse_stack; // maximum stack allocation
|
||||
size_t maxuse_stack; // maximum stack allocation
|
||||
size_t maxuse_arena; // maximum arena allocation
|
||||
int maxuse_con; // maximum number of contacts
|
||||
int maxuse_efc; // maximum number of scalar constraints
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
d->pstack = _mark; \
|
||||
ASAN_POISON_MEMORY_REGION( \
|
||||
(char*)d->arena + d->parena, \
|
||||
(d->nstack - d->pstack) * sizeof(mjtNum) - d->parena ); \
|
||||
d->narena - d->pstack - d->parena); \
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
#ifndef MUJOCO_MJMODEL_H_
|
||||
#define MUJOCO_MJMODEL_H_
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include <mujoco/mjtnum.h>
|
||||
|
||||
// global constants
|
||||
@@ -623,12 +625,12 @@ struct mjModel_ {
|
||||
int nemax; // number of potential equality-constraint rows
|
||||
int njmax; // number of available rows in constraint Jacobian
|
||||
int nconmax; // number of potential contacts in contact list
|
||||
int nstack; // number of fields in mjData stack
|
||||
int nuserdata; // number of extra fields in mjData
|
||||
int nsensordata; // number of fields in sensor data vector
|
||||
int npluginstate; // number of fields in plugin state vector
|
||||
|
||||
int nbuffer; // number of bytes in buffer
|
||||
size_t narena; // number of bytes in the mjData arena (inclusive of stack)
|
||||
size_t nbuffer; // number of bytes in buffer
|
||||
|
||||
// ------------------------------- options and statistics
|
||||
|
||||
|
||||
@@ -125,10 +125,10 @@
|
||||
X ( njmax ) \
|
||||
X ( nconmax ) \
|
||||
XMJV( ntree ) \
|
||||
X ( nstack ) \
|
||||
X ( nuserdata ) \
|
||||
XMJV( nsensordata ) \
|
||||
X ( npluginstate ) \
|
||||
X ( narena ) \
|
||||
X ( nbuffer )
|
||||
|
||||
|
||||
@@ -620,13 +620,13 @@
|
||||
|
||||
// scalar fields of mjData
|
||||
#define MJDATA_SCALAR \
|
||||
X( int, nstack ) \
|
||||
X( int, nbuffer ) \
|
||||
X( size_t, narena ) \
|
||||
X( size_t, nbuffer ) \
|
||||
X( int, nplugin ) \
|
||||
X( int, pstack ) \
|
||||
X( int, parena ) \
|
||||
X( int, maxuse_stack ) \
|
||||
X( int, maxuse_arena ) \
|
||||
X( size_t, pstack ) \
|
||||
X( size_t, parena ) \
|
||||
X( size_t, maxuse_stack ) \
|
||||
X( size_t, maxuse_arena ) \
|
||||
X( int, maxuse_con ) \
|
||||
X( int, maxuse_efc ) \
|
||||
X( int, solver_iter ) \
|
||||
|
||||
Reference in New Issue
Block a user