###Inuse stack purpose?###
Inuse stack purpose?
I'm not sure what purpose your inuse
stack serves. If you create a pool of 100 items, and then call get()
followed by put()
, you will have put one item on the inuse
stack which also appears on the reuse
stack. If you do this again, you will put the same item on the inuse
stack a second time (a duplicate). Repeat 100 times and the inuse
stack will become full and you won't be able to allocate any more items, even though there are actually all 100 items left to allocate.
The inuse
stack should be replaced by a simple counter of how many items are in use. You can increment the counter on each get
and decrement it on each put
.
###Inuse stack purpose?###
I'm not sure what purpose your inuse
stack serves. If you create a pool of 100 items, and then call get()
followed by put()
, you will have put one item on the inuse
stack which also appears on the reuse
stack. If you do this again, you will put the same item on the inuse
stack a second time (a duplicate). Repeat 100 times and the inuse
stack will become full and you won't be able to allocate any more items, even though there are actually all 100 items left to allocate.
The inuse
stack should be replaced by a simple counter of how many items are in use. You can increment the counter on each get
and decrement it on each put
.
Inuse stack purpose?
I'm not sure what purpose your inuse
stack serves. If you create a pool of 100 items, and then call get()
followed by put()
, you will have put one item on the inuse
stack which also appears on the reuse
stack. If you do this again, you will put the same item on the inuse
stack a second time (a duplicate). Repeat 100 times and the inuse
stack will become full and you won't be able to allocate any more items, even though there are actually all 100 items left to allocate.
The inuse
stack should be replaced by a simple counter of how many items are in use. You can increment the counter on each get
and decrement it on each put
.
###Inuse stack purpose?###
I'm not sure what purpose your inuse
stack serves. If you create a pool of 100 items, and then call get()
followed by put()
, you will have put one item on the inuse
stack which also appears on the reuse
stack. If you do this again, you will put the same item on the inuse
stack a second time (a duplicate). Repeat 100 times and the inuse
stack will become full and you won't be able to allocate any more items, even though there are actually all 100 items left to allocate.
The inuse
stack should be replaced by a simple counter of how many items are in use. You can increment the counter on each get
and decrement it on each put
.