The terms "automatic" and "dynamic" storage are arguably preferable in the C++ specifications over "stack" and "heap" respectively because the C++ specifications do not require that allocation/deallocation be implemented specifically using the stack/heap model.

Are there any alternate models for allocation/deallocation other than stack and heap?

2

There are 2 best solutions below

5
On

The terminology opinions seem to be based on faulty assumptions.

Regarding allocation schemes, it's difficult to grok what you mean by "heap", but if you mean explicit deallocation of dynamically allocated objects, then C++ has never formally required that. When garbage collection gained some support in C++11 it was because it was already proven technology, with e.g. the Boehm garbage collector for C++03.

C++ does require and has always required a stack, but not any particular implementation of that stack. With fine-grained cooperative multitasking it may be that we'll see implementations that use linked list based stacks. I don't know any such yet, though, as of medio 2016.

3
On

There's been plenty of research done in allocators (fortunate or not), with different memory layout, segregation, etc. Andrei Alexandrescu authored a cool presentation about those CppCon 2015: Andrei Alexandrescu “std::allocator...”. You may find it useful.

One of the examples he provides may shed some light on the possibilities:

typedef Segregator<4096,
    Segregator<128,
        Freelist<Mallocator, 0, 128>,
        MediumAllocator>,
    Mallocator>
Allocator;

Allocation strategy:

  • if object is smaller than than 4096B:
    • if object is smaller than 128B use a Freelist (batches of elements),
    • else use a MediumAllocator (supposedly good for medium sized objects),
  • else use Mallocator (based on malloc) to alloc memory block.

Ergo depending on the type of objects, you may use a different allocation strategy (there's also a stack-based allocator to choose from).