Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

内容出现重复,可能是写错误的 #16

Open
Rgoogle opened this issue Mar 22, 2024 · 0 comments
Open

内容出现重复,可能是写错误的 #16

Rgoogle opened this issue Mar 22, 2024 · 0 comments

Comments

@Rgoogle
Copy link

Rgoogle commented Mar 22, 2024

在第二章的内存部分

裸指针偏移计算相关方法
ptr::const T::offset(self, count:isize)-> const T 得到偏移后的裸指针
ptr::*const T::wrapping_offset(self, count: isize) -> *const T 考虑溢出绕回的offset
ptr::*const T::offset_from(self, origin: *const T) -> isize 计算两个裸指针的offset值
ptr::mut T::offset(self, count:isize)-> mut T 偏移后的裸指针
ptr::*const T::wrapping_offset(self, count: isize) -> *const T 考虑溢出绕回的offset
ptr::*const T::offset_from(self, origin: *const T) -> isize 计算两个裸指针的offset值
以上两个方法基本上通过intrinsic的函数实现

最后的两个函数和前面的重复了ptr::*const T::offset_from(self, origin: *const T) -> isize 比如这个就出现了两次。
还有在最新的rust版本里面有些函数已经不存在了。该仓库应该注明该文章有效的rust版本号

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant