stack with reallocation functionality