Variable-length Array - Memory Allocation

Memory Allocation

One problem that may be hidden by a language's support for VLAs is that of the underlying memory allocation: in environments where there is a clear distinction between a heap and a stack, it may not be clear which, if any, of those will store the VLA.

For example, the GNU C Compiler allocates memory for VLAs on the stack. VLAs, like all objects in C, are limited to SIZE_MAX bytes.

Read more about this topic:  Variable-length Array

Famous quotes containing the word memory:

    Twenty or thirty years ago, in the army, we had a lot of obscure adventures, and years later we tell them at parties, and suddenly we realize that those two very difficult years of our lives have become lumped together into a few episodes that have lodged in our memory in a standardized form, and are always told in a standardized way, in the same words. But in fact that lump of memories has nothing whatsoever to do with our experience of those two years in the army and what it has made of us.
    Václav Havel (b. 1936)