support initialize the stack with given capacity
support generic
support generic