Skip to content

Commit 6abb505

Browse files
author
Steve Wishnousky
authored
Clarify _malloca error behavior
1 parent 2192dfc commit 6abb505

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎docs/c-runtime-library/reference/malloca.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Bytes to be allocated from the stack.
2929

3030
The **_malloca** routine returns a **void** pointer to the allocated space, which is guaranteed to be suitably aligned for storage of any type of object. If *size* is 0, **_malloca** allocates a zero-length item and returns a valid pointer to that item.
3131

32-
A stack overflow exception is generated if the space cannot be allocated. The stack overflow exception is not a C++ exception; it is a structured exception. Instead of using C++ exception handling, you must use [Structured Exception Handling](../../cpp/structured-exception-handling-c-cpp.md) (SEH).
32+
If *size* is greater than **_ALLOCA_S_THRESHOLD**, then **_malloca** will attempt to allocate on the heap and return a null pointer if the space cannot be allocated. If *size* is less than or equal to **_ALLOCA_S_THRESHOLD**, then **_malloca** will attempt to allocate on the stack and a stack overflow exception will be generated if the space cannot be allocated. The stack overflow exception is not a C++ exception; it is a structured exception. Instead of using C++ exception handling, you must use [Structured Exception Handling](../../cpp/structured-exception-handling-c-cpp.md) (SEH).
3333

3434
## Remarks
3535

0 commit comments

Comments
 (0)