Removing alloca compat include.

This commit is contained in:
Бранимир Караџић
2024-12-21 19:24:50 -08:00
parent 6dfd865300
commit 896c610b72
11 changed files with 30 additions and 30 deletions

View File

@@ -707,7 +707,7 @@ uint16_t weldVertices(WeldedVertex* _output, const bgfx::VertexLayout& _layout,
uint16_t numVertices = 0;
const uint32_t size = sizeof(uint16_t)*(hashSize + _num);
uint16_t* hashTable = (uint16_t*)alloca(size);
uint16_t* hashTable = (uint16_t*)BX_STACK_ALLOC(size);
bx::memSet(hashTable, 0xff, size);
uint16_t* next = hashTable + hashSize;

View File

@@ -339,7 +339,7 @@ void VectorDisplay::endDraw()
// from the list of points, build a list of lines
uint32_t nlines = (uint32_t)m_pendingPoints.size() - 1;
Line* lines = (Line*)alloca(nlines * sizeof(Line) );
Line* lines = (Line*)BX_STACK_ALLOC(nlines * sizeof(Line) );
float t = effectiveThickness();
int first_last_same = true
@@ -630,7 +630,7 @@ void VectorDisplay::drawFan(float _cx, float _cy, float _pa, float _a, float _t,
{
_t = -_t;
nsteps = (int32_t)bx::max(1.0f, bx::round(a2pa / (bx::kPi / 8.0f) ) );
angles = (float*)alloca(sizeof(float) * (nsteps + 1) );
angles = (float*)BX_STACK_ALLOC(sizeof(float) * (nsteps + 1) );
for (i = 0; i <= nsteps; i++)
{
angles[i] = _a + i * a2pa / nsteps;
@@ -639,7 +639,7 @@ void VectorDisplay::drawFan(float _cx, float _cy, float _pa, float _a, float _t,
else
{
nsteps = (int32_t)bx::max(1.0f, bx::round(pa2a / (bx::kPi / 8.0f) ) );
angles = (float*)alloca(sizeof(float) * (nsteps + 1) );
angles = (float*)BX_STACK_ALLOC(sizeof(float) * (nsteps + 1) );
for (i = 0; i <= nsteps; i++)
{
angles[i] = _pa + i * pa2a / nsteps;

View File

@@ -1169,7 +1169,7 @@ struct DebugDrawEncoderImpl
}
else
{
mtx = (float*)alloca(_num*64);
mtx = (float*)BX_STACK_ALLOC(_num*64);
for (uint16_t ii = 0; ii < _num; ++ii)
{
const float* mtxTransform = (const float*)_mtx;

View File

@@ -176,7 +176,7 @@ void showExampleDialog(entry::AppI* _app, const char* _errorText)
{
uint32_t num = entry::getNumApps();
const char** items = (const char**)alloca(num*sizeof(void*) );
const char** items = (const char**)BX_STACK_ALLOC(num*sizeof(void*) );
uint32_t ii = 0;
int32_t current = 0;