1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | unsigned char a[4]; // no asm generated (?) // removed cast in case it generated extra asm // char* b = (char*)_alloca(4); void* b = _alloca(4); 0130142B mov eax,dword ptr [ebp-11Ch] 01301431 call __alloca_probe_16 (013011F4h) 01301436 mov dword ptr [ebp-120h],esp 0130143C lea ecx,[ebp-54h] 0130143F push ecx 01301440 mov edx,dword ptr [ebp-11Ch] 01301446 mov ecx,dword ptr [ebp-120h] 0130144C call @_RTC_AllocaHelper@12 (01301037h) 01301451 add dword ptr [ebp-120h],20h 01301458 mov edx,dword ptr [ebp-120h] 0130145E mov dword ptr [b],edx |
1 2 3 4 5 6 7 8 | void f() { for (int i=0; i<1024; i++) { void* mem = alloca(100); ... } } |
1 2 | int i = ...; char arr[i]; |