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
use bitcask;use bytesize::ByteSize;fnmain(){let options = bitcask::Options{base_dir: std::path::PathBuf::from("./db1"),data_file_limit:ByteSize::mb(10).as_u64(),};let db = bitcask::new(options);ifletErr(err_msg) = db {println!("{}", err_msg);
std::process::exit(1);}letmut db = db.unwrap();for n in0..1000{let name = format!("Peter Nr. {}", n);let key = format!("name:{}", n);
db.write(key.as_bytes(), name.as_bytes()).unwrap();}
db.close().unwrap();}
error report:
thread 'main' panicked at 'attempted to leave type `database::lru::LruEntry<u128, datafile::DataFile>` uninitialized, which is invalid', /home/xx/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/mod.rs:659:9
stack backtrace:
0: rust_begin_unwind
at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/panicking.rs:493:5
1: core::panicking::panic_fmt
at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/core/src/panicking.rs:92:14
2: core::panicking::panic
at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/core/src/panicking.rs:50:5
3: core::mem::uninitialized
at /home/xx/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/mod.rs:659:9
4: lru::LruCache<K,V,S>::construct
at /home/xx/.cargo/registry/src/github.com-1ecc6299db9ec823/lru-0.1.17/src/lib.rs:216:51
5: lru::LruCache<K,V>::new
at /home/xx/.cargo/registry/src/github.com-1ecc6299db9ec823/lru-0.1.17/src/lib.rs:173:9
6: bitcask::database::new
at /home/xx/.cargo/git/checkouts/bitcask-ef3cb47bcd03a3bd/f218892/src/database.rs:75:27
7: bitcask_rs::main
at ./src/main.rs:10:14
8: core::ops::function::FnOnce::call_once
at /home/xx/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
The text was updated successfully, but these errors were encountered:
@dollarkillerx Sorry for getting back to you late, and THANK YOU very much for reporting this error. I will have a look when I have some free time. Feel free to send a pull request.
run demo:
error report:
The text was updated successfully, but these errors were encountered: