In documentation, it says SegQueue is unbounded queue. Let's assume that we have enough memory(memory is really big); if we use SegQueue, and keep pushing, never pop a value, index of tail will increase to the max value of usize type, unfortunately, we continue to push a value, index will be 0 because of usize wrapping_add method, at this moment, index of tail and index of head will bring a problem: SegQueue is empty in is_empty method of SegQueue ! By the way, in practical, memory is not really big as we assumed, and memory exhaustion will come first, as a result, we never see the problem that SegQueue is empty.
In documentation, it says SegQueue is unbounded queue. Let's assume that we have enough memory(memory is really big); if we use SegQueue, and keep pushing, never pop a value, index of tail will increase to the max value of usize type, unfortunately, we continue to push a value, index will be 0 because of usize
wrapping_addmethod, at this moment, index of tail and index of head will bring a problem: SegQueue is empty inis_emptymethod of SegQueue ! By the way, in practical, memory is not really big as we assumed, and memory exhaustion will come first, as a result, we never see the problem that SegQueue is empty.