|
|
|
|
|
by adrian_b
142 days ago
|
|
True, but in many environments where C is used the stacks may be configured with small sizes and without the possibility of being grown dynamically. In such environments, it may be needed to estimate the maximum stack usage and configure big enough stacks, if possible. Having to estimate maximum memory usage is the same constraint when allocating a static array as a work area, then using a custom allocator to provide memory when needed. |
|
We mainly use C++, not C, and we do this with polymorphic allocators. This is our main allocator for local stack:
https://bloomberg.github.io/bde-resources/doxygen/bde_api_pr...
… or this for supplying a large external static buffer:
https://bloomberg.github.io/bde-resources/doxygen/bde_api_pr...