You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 inis_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.The text was updated successfully, but these errors were encountered: