文件名称:byte-pool:灵活的字节池
文件大小:12KB
文件格式:ZIP
更新时间:2024-05-03 05:54:15
Rust
字节池 灵活的字节池。 | 例子 use byte_pool :: BytePool; // Create a pool let pool = BytePool :: < Vec>> :: new (); // Allocate a buffer let mut buf = pool. alloc ( 1024 ); // write some data into it for i in 0 .. 100 { buf[i] = 12 ; } // Check that we actually wrote sth. assert_eq! (buf[ 55 ], 12 ); // Returns the underlying memory to the pool. drop (buf); // Frees all memory in the pool. drop (pool);
【文件预览】:
byte-pool-master
----LICENSE-MIT(1KB)
----LICENSE-APACHE(11KB)
----.github()
--------workflows()
----src()
--------pool.rs(7KB)
--------poolable.rs(2KB)
--------lib.rs(625B)
----Cargo.toml(598B)
----benches()
--------main.rs(4KB)
----.gitignore(30B)
----README.md(2KB)