Rename mj_stackAlloc to mj_stackAllocByte.
PiperOrigin-RevId: 566351365 Change-Id: I91541168e83b05a730113661cc9f07985ac9ff0c
This commit is contained in:
committed by
Copybara-Service
parent
812e617fe9
commit
9902b73502
@@ -1251,12 +1251,12 @@ mj_freeStack
|
||||
Free the current :ref:`mjData` stack frame. All pointers returned by mj_stackAlloc since the last call
|
||||
to mj_markStack must no longer be used afterwards.
|
||||
|
||||
.. _mj_stackAlloc:
|
||||
.. _mj_stackAllocByte:
|
||||
|
||||
mj_stackAlloc
|
||||
~~~~~~~~~~~~~
|
||||
mj_stackAllocByte
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mj_stackAlloc
|
||||
.. mujoco-include:: mj_stackAllocByte
|
||||
|
||||
Allocate a number of bytes on :ref:`mjData` stack at a specific alignment.
|
||||
Call mju_error on stack overflow.
|
||||
|
||||
+3
-3
@@ -43,10 +43,10 @@ General
|
||||
:ref:`mj_freeStack`. These functions manage the :ref:`mjData stack<siStack>` in a fully encapsulated way (i.e.,
|
||||
without introducing a local variable at the call site).
|
||||
|
||||
5. Changed the function :ref:`mj_stackAlloc` to allocate an arbitrary number of bytes, rather than in multiples of
|
||||
``sizeof(mjtNum)``, and added an additional argument for specifying the alignment of the returned pointer.
|
||||
5. Renamed ``mj_stackAlloc`` to :ref:`mj_stackAllocNum`. The new function :ref:`mj_stackAllocByte` allocates an
|
||||
arbitrary number of bytes and has an additional argument for specifying the alignment of the returned pointer.
|
||||
|
||||
**Migration:** The functionality for allocating ``mjtNum`` arrays is available via :ref:`mj_stackAllocNum`.
|
||||
**Migration:** The functionality for allocating ``mjtNum`` arrays is now available via :ref:`mj_stackAllocNum`.
|
||||
|
||||
6. Renamed the ``nstack`` field in :ref:`mjModel` and :ref:`mjData` to ``narena``. Changed ``narena``, ``pstack``,
|
||||
and ``maxuse_stack`` to count number of bytes rather than number of :ref:`mjtNum` |-| s.
|
||||
|
||||
@@ -2233,7 +2233,7 @@ void mj_resetDataDebug(const mjModel* m, mjData* d, unsigned char debug_value);
|
||||
void mj_resetDataKeyframe(const mjModel* m, mjData* d, int key);
|
||||
void mj_markStack(mjData* d);
|
||||
void mj_freeStack(mjData* d);
|
||||
void* mj_stackAlloc(mjData* d, size_t bytes, size_t alignment);
|
||||
void* mj_stackAllocByte(mjData* d, size_t bytes, size_t alignment);
|
||||
mjtNum* mj_stackAllocNum(mjData* d, int size);
|
||||
int* mj_stackAllocInt(mjData* d, int size);
|
||||
void mj_deleteData(mjData* d);
|
||||
|
||||
@@ -721,7 +721,7 @@ The function :ref:`mj_stackAllocNum` checks if there is enough space, and if so
|
||||
otherwise it triggers an error. It also keeps track of the maximum stack allocation;
|
||||
see :ref:`diagnostics <siDiagnostics>` below. Note that :ref:`mj_stackAllocNum` is only used for allocating
|
||||
``mjtNum`` arrays, the most common type of array. :ref:`mj_stackAllocInt` is provided for integer array allocation,
|
||||
and :ref:`mj_stackAlloc` is provided for allocation of arbitrary number of bytes and alignment.
|
||||
and :ref:`mj_stackAllocByte` is provided for allocation of arbitrary number of bytes and alignment.
|
||||
|
||||
.. _siError:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user