Rename mj_stackAllocByte to mj_stackAlloc and make it public.
PiperOrigin-RevId: 561133040 Change-Id: I4f5ffe51c1287aa0c82af68bfe17ed6dd2ad09da
This commit is contained in:
committed by
Copybara-Service
parent
a48e0aa355
commit
4c899b92cc
@@ -33,12 +33,11 @@ constexpr int GetExpectedStackUsageBytes() {
|
||||
return 0;
|
||||
} else {
|
||||
constexpr auto RoundUpToAlignment =
|
||||
[](int x) {
|
||||
constexpr auto kAlignment = alignof(std::max_align_t);
|
||||
return kAlignment * (x / kAlignment + ((x % kAlignment) ? 1 : 0));
|
||||
[](int x, int alignment) {
|
||||
return alignment * (x / alignment + ((x % alignment) ? 1 : 0));
|
||||
};
|
||||
return RoundUpToAlignment(sizeof(mjArrayList)) +
|
||||
RoundUpToAlignment(Capacity * sizeof(T)) +
|
||||
return RoundUpToAlignment(sizeof(mjArrayList), alignof(mjArrayList)) +
|
||||
RoundUpToAlignment(Capacity * sizeof(T), alignof(std::max_align_t)) +
|
||||
GetExpectedStackUsageBytes<T, N - Capacity, 2 * Capacity>();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user