-
-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
实现了对用户空间传入指针抽象的UserBufferReader/Writer,来检验用户空间指针地址并提供一定的功能抽象 (#326)
* 构建了 Userbuffer 对用户空间传入的指针进行了抽象,并提供了读写操作 * 分成了Reader和Writer,增加了从地址读和写入到指定地址的功能 * 删除了多余的注释 * 增加了直接获取BufferWriter切片的函数 * 通过 where 的一个 Trick 实现了 const generic 和后续功能 * 替换为了 core::slice::align_to 实现&[u8}转&[T] * 移除了 userbuffer.rs * 提供了独立获取缓冲区中不同偏移量位置的数据的函数 * 替换了部分系统调用(还未测试 * 简化了代码 * 修复内存越界的bug --------- Co-authored-by: longjin <[email protected]>
- Loading branch information
Showing
2 changed files
with
245 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters