Use alloca for stack based memory allocation

This commit is contained in:
Marius Greuel
2022-01-07 17:23:50 +01:00
parent d05c2db3fb
commit fe6f08d48f
5 changed files with 14 additions and 42 deletions

View File

@@ -760,11 +760,7 @@ static int stk500_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
unsigned int page_size,
unsigned int addr, unsigned int n_bytes)
{
#ifdef _MSC_VER
unsigned char* buf = _alloca(page_size + 16);
#else
unsigned char buf[page_size + 16];
#endif
unsigned char* buf = alloca(page_size + 16);
int memtype;
int a_div;
int block_size;