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
This might just be a documentation issue, but I was assuming that grant_max should behave identically to grant wrt. the successful case. An example:
use bbqueue::*;fnmain(){let bbq = bbq!(1000).unwrap();let size = 999;let grant = bbq.grant(size).unwrap();
bbq.commit(size, grant);let grant = bbq.read().unwrap();
bbq.release(size, grant);let grant = bbq.grant_max(500).unwrap();println!("{}", grant.len());
bbq.commit(0, grant);}
This consumes and then frees all but 1 Byte of the queue. Then it tries to obtain a 500-byte grant using grant_max. I would expect this to succeed and return the requested 500-byte grant, since there's a large 999-byte area that's still free. Instead it returns a grant of length 1.
Using grant instead will successfully grant 500 bytes.
The text was updated successfully, but these errors were encountered:
This might just be a documentation issue, but I was assuming that
grant_max
should behave identically togrant
wrt. the successful case. An example:This consumes and then frees all but 1 Byte of the queue. Then it tries to obtain a 500-byte grant using
grant_max
. I would expect this to succeed and return the requested 500-byte grant, since there's a large 999-byte area that's still free. Instead it returns a grant of length 1.Using
grant
instead will successfully grant 500 bytes.The text was updated successfully, but these errors were encountered: