Mark some mjData fields as mutable.
PiperOrigin-RevId: 815819490 Change-Id: I1a62fda556b4197aec451f2747c69f34bab13220
This commit is contained in:
committed by
Copybara-Service
parent
52eff3da0f
commit
414888b716
@@ -156,14 +156,14 @@ struct mjData_ {
|
|||||||
int nplugin; // number of plugin instances
|
int nplugin; // number of plugin instances
|
||||||
|
|
||||||
// stack pointer
|
// stack pointer
|
||||||
size_t pstack; // first available byte in stack
|
size_t pstack; // first available byte in stack (mutable)
|
||||||
size_t pbase; // value of pstack when mj_markStack was last called
|
size_t pbase; // value of pstack when mj_markStack was last called (mutable)
|
||||||
|
|
||||||
// arena pointer
|
// arena pointer
|
||||||
size_t parena; // first available byte in arena
|
size_t parena; // first available byte in arena
|
||||||
|
|
||||||
// memory utilization statistics
|
// memory utilization statistics
|
||||||
mjtSize maxuse_stack; // maximum stack allocation in bytes
|
mjtSize maxuse_stack; // maximum stack allocation in bytes (mutable)
|
||||||
mjtSize maxuse_threadstack[mjMAXTHREAD]; // maximum stack allocation per thread in bytes
|
mjtSize maxuse_threadstack[mjMAXTHREAD]; // maximum stack allocation per thread in bytes
|
||||||
mjtSize maxuse_arena; // maximum arena allocation in bytes
|
mjtSize maxuse_arena; // maximum arena allocation in bytes
|
||||||
int maxuse_con; // maximum number of contacts
|
int maxuse_con; // maximum number of contacts
|
||||||
@@ -176,7 +176,7 @@ struct mjData_ {
|
|||||||
mjtNum solver_fwdinv[2]; // forward-inverse comparison: qfrc, efc
|
mjtNum solver_fwdinv[2]; // forward-inverse comparison: qfrc, efc
|
||||||
|
|
||||||
// diagnostics
|
// diagnostics
|
||||||
mjWarningStat warning[mjNWARNING]; // warning statistics
|
mjWarningStat warning[mjNWARNING]; // warning statistics (mutable)
|
||||||
mjTimerStat timer[mjNTIMER]; // timer statistics
|
mjTimerStat timer[mjNTIMER]; // timer statistics
|
||||||
|
|
||||||
// variable sizes
|
// variable sizes
|
||||||
|
|||||||
@@ -188,14 +188,14 @@ struct mjData_ {
|
|||||||
int nplugin; // number of plugin instances
|
int nplugin; // number of plugin instances
|
||||||
|
|
||||||
// stack pointer
|
// stack pointer
|
||||||
size_t pstack; // first available byte in stack
|
size_t pstack; // first available byte in stack (mutable)
|
||||||
size_t pbase; // value of pstack when mj_markStack was last called
|
size_t pbase; // value of pstack when mj_markStack was last called (mutable)
|
||||||
|
|
||||||
// arena pointer
|
// arena pointer
|
||||||
size_t parena; // first available byte in arena
|
size_t parena; // first available byte in arena
|
||||||
|
|
||||||
// memory utilization statistics
|
// memory utilization statistics
|
||||||
mjtSize maxuse_stack; // maximum stack allocation in bytes
|
mjtSize maxuse_stack; // maximum stack allocation in bytes (mutable)
|
||||||
mjtSize maxuse_threadstack[mjMAXTHREAD]; // maximum stack allocation per thread in bytes
|
mjtSize maxuse_threadstack[mjMAXTHREAD]; // maximum stack allocation per thread in bytes
|
||||||
mjtSize maxuse_arena; // maximum arena allocation in bytes
|
mjtSize maxuse_arena; // maximum arena allocation in bytes
|
||||||
int maxuse_con; // maximum number of contacts
|
int maxuse_con; // maximum number of contacts
|
||||||
@@ -208,7 +208,7 @@ struct mjData_ {
|
|||||||
mjtNum solver_fwdinv[2]; // forward-inverse comparison: qfrc, efc
|
mjtNum solver_fwdinv[2]; // forward-inverse comparison: qfrc, efc
|
||||||
|
|
||||||
// diagnostics
|
// diagnostics
|
||||||
mjWarningStat warning[mjNWARNING]; // warning statistics
|
mjWarningStat warning[mjNWARNING]; // warning statistics (mutable)
|
||||||
mjTimerStat timer[mjNTIMER]; // timer statistics
|
mjTimerStat timer[mjNTIMER]; // timer statistics
|
||||||
|
|
||||||
// variable sizes
|
// variable sizes
|
||||||
|
|||||||
@@ -5003,12 +5003,12 @@ STRUCTS: Mapping[str, StructDecl] = dict([
|
|||||||
StructFieldDecl(
|
StructFieldDecl(
|
||||||
name='pstack',
|
name='pstack',
|
||||||
type=ValueType(name='size_t'),
|
type=ValueType(name='size_t'),
|
||||||
doc='first available byte in stack',
|
doc='first available byte in stack (mutable)',
|
||||||
),
|
),
|
||||||
StructFieldDecl(
|
StructFieldDecl(
|
||||||
name='pbase',
|
name='pbase',
|
||||||
type=ValueType(name='size_t'),
|
type=ValueType(name='size_t'),
|
||||||
doc='value of pstack when mj_markStack was last called',
|
doc='value of pstack when mj_markStack was last called (mutable)', # pylint: disable=line-too-long
|
||||||
),
|
),
|
||||||
StructFieldDecl(
|
StructFieldDecl(
|
||||||
name='parena',
|
name='parena',
|
||||||
@@ -5018,7 +5018,7 @@ STRUCTS: Mapping[str, StructDecl] = dict([
|
|||||||
StructFieldDecl(
|
StructFieldDecl(
|
||||||
name='maxuse_stack',
|
name='maxuse_stack',
|
||||||
type=ValueType(name='mjtSize'),
|
type=ValueType(name='mjtSize'),
|
||||||
doc='maximum stack allocation in bytes',
|
doc='maximum stack allocation in bytes (mutable)',
|
||||||
),
|
),
|
||||||
StructFieldDecl(
|
StructFieldDecl(
|
||||||
name='maxuse_threadstack',
|
name='maxuse_threadstack',
|
||||||
@@ -5081,7 +5081,7 @@ STRUCTS: Mapping[str, StructDecl] = dict([
|
|||||||
inner_type=ValueType(name='mjWarningStat'),
|
inner_type=ValueType(name='mjWarningStat'),
|
||||||
extents=(8,),
|
extents=(8,),
|
||||||
),
|
),
|
||||||
doc='warning statistics',
|
doc='warning statistics (mutable)',
|
||||||
),
|
),
|
||||||
StructFieldDecl(
|
StructFieldDecl(
|
||||||
name='timer',
|
name='timer',
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class StructsTest(absltest.TestCase):
|
|||||||
if field.name == 'warning':
|
if field.name == 'warning':
|
||||||
self.assertEqual(field.type,
|
self.assertEqual(field.type,
|
||||||
type_parsing.parse_type('mjWarningStat[8]'))
|
type_parsing.parse_type('mjWarningStat[8]'))
|
||||||
self.assertEqual(field.doc, 'warning statistics')
|
self.assertEqual(field.doc, 'warning statistics (mutable)')
|
||||||
elif field.name == 'qpos':
|
elif field.name == 'qpos':
|
||||||
self.assertEqual(field.type, type_parsing.parse_type('mjtNum*'))
|
self.assertEqual(field.type, type_parsing.parse_type('mjtNum*'))
|
||||||
self.assertEqual(field.doc, 'position')
|
self.assertEqual(field.doc, 'position')
|
||||||
|
|||||||
Reference in New Issue
Block a user