Name
$MaxStackSize Compiler Directive
Syntax
{$MaxStackSize Integer}Scope
Project
Description
$MaxStackSize
set the program’s maximum stack
size in bytes. A library ignores this compiler directive because a
DLL does not have its own stack. The default maximum stack size is 1
MB (1048576 bytes), which is more than adequate for most
programs.
Windows creates the stack with the minimum stack size specified with
the $MinStackSize directive, and the stack grows
as needed, up to the maximum size. If the stack size reaches the
maximum size, Delphi reports runtime error 12
(EStackOverflow).
In most programs, if you get a stack overflow error, it is due to a software defect, such as unbounded recursion. Check closely for mistakes before you increase the maximum stack size.
See Also
| $M Compiler Directive, $MinStackSize Compiler Directive |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access