don't truncate key allocations that have an alloc_hint specified

This commit is contained in:
bunnie 2022-07-02 00:09:21 +08:00
parent a1950a4c00
commit ae37c2cd02

View file

@ -842,7 +842,9 @@ fn wrapped_main() -> ! {
// create an empty key placeholder
let empty: [u8; 0] = [];
match basis_cache.key_update(&mut pddb_os,
dict, key, &empty, None, alloc_hint, bname, true
dict, key, &empty, None, alloc_hint, bname,
// don't truncate if we've been given an explicit size hint.
alloc_hint.is_none()
) {
Ok(_) => {},
Err(e) => {