Switch from max_align_t to mjtNum until we sort out the git builds
PiperOrigin-RevId: 558982369 Change-Id: I24d9fd6400dae5e1bc1753ee74484da635ea8ecd
This commit is contained in:
committed by
Copybara-Service
parent
c2e586f303
commit
1d36b57d83
@@ -1213,8 +1213,9 @@ void* mj_stackAllocBytes(mjData* d, size_t size) {
|
|||||||
// start of the memory to be allocated to the buffer
|
// start of the memory to be allocated to the buffer
|
||||||
uintptr_t start_ptr = end_ptr - (size + mjREDZONE);
|
uintptr_t start_ptr = end_ptr - (size + mjREDZONE);
|
||||||
|
|
||||||
// move start_ptr back to align to max_align_t
|
// move start_ptr back to align to mjtNum
|
||||||
start_ptr -= start_ptr % _Alignof(max_align_t);
|
// TODO: switch to max_align_t
|
||||||
|
start_ptr -= start_ptr % _Alignof(mjtNum);
|
||||||
|
|
||||||
// new top of the stack
|
// new top of the stack
|
||||||
uintptr_t new_pstack_ptr = start_ptr - mjREDZONE;
|
uintptr_t new_pstack_ptr = start_ptr - mjREDZONE;
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ TEST(TestMjArrayList, TestMjArrayListSingleThreaded) {
|
|||||||
|
|
||||||
// Approximately (3 * sizeof(int) + 3 * sizeof(mjArrayList)) / sizeof(mjtNum)
|
// Approximately (3 * sizeof(int) + 3 * sizeof(mjArrayList)) / sizeof(mjtNum)
|
||||||
// However there is padding for alignment/etc.
|
// However there is padding for alignment/etc.
|
||||||
EXPECT_EQ(d->maxuse_stack, 54);
|
EXPECT_EQ(d->maxuse_stack, 53);
|
||||||
|
|
||||||
for (int i = 0; i < 35; ++i) {
|
for (int i = 0; i < 35; ++i) {
|
||||||
EXPECT_EQ(*(int*)mju_arrayListAt(array_list, i), i);
|
EXPECT_EQ(*(int*)mju_arrayListAt(array_list, i), i);
|
||||||
|
|||||||
Reference in New Issue
Block a user