stack with memcpy and resizeable array