Improve Rust implementation

- Move mmap_file implementation into Rust
- Introduce Utf8CStr as the better c-string type to use
This commit is contained in:
topjohnwu
2023-06-12 01:07:43 -07:00
committed by John Wu
parent 866386e21f
commit 23c1f0111b
9 changed files with 352 additions and 118 deletions

View File

@@ -45,10 +45,8 @@ struct mmap_data : public byte_data {
ALLOW_MOVE_ONLY(mmap_data)
explicit mmap_data(const char *name, bool rw = false);
mmap_data(int fd, size_t sz, bool rw = false) { init(fd, sz, rw); }
mmap_data(int fd, size_t sz, bool rw = false);
~mmap_data();
private:
void init(int fd, size_t sz, bool rw);
};
extern "C" {