我们常用的指针(我们通常使用的指针)、近指针和远指针之间有什么区别?近指针和远指针在当今的 C/C++ 系统中是否有实际用途?任何需要使用这些特定指针而不是其他 c、c++ 语义的实际场景都将非常有帮助.
What is difference between our usual pointers(ones which we normally use), near pointers and far pointers and is there a practical usage for near and far pointers in present day C/C++ systems? Any practical scenario which necessiates use of these specific pointers and not other c,c++ semantics will be very helpful.
near 和 far 关键字起源于 Intel 之前的分段内存模型.Near 指针只能访问一个最初大小约为 64Kb 的内存块,称为段,而远指针可以超出该范围,该范围由段和该段中的偏移量组成.Near 指针比 far 指针快得多,因此在某些情况下使用它们是值得的.
The near and far keywords have their origin in the segmented memory model that Intel had before. The near pointers could only access a block of memory originally around 64Kb in size called a segment whereas the far pointers could go outside of that range consisting of a segment and offset in that segment. The near pointers were much faster than far pointers so therefore in some contexts it paid off to use them.
现在使用虚拟内存,near 和 far 指针已经没有用处了.
Nowadays with virtual memory near and far pointers have no use.
对不起,如果我没有使用正确的术语,但这是我在当天使用它时的记忆:-)
Sorry if I am not using the correct terms, but this is how I remembered it when I was working with it back in the day :-)
这篇关于远近指针的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
std::reference_wrapper 和简单指针的区别?Difference between std::reference_wrapper and simple pointer?(std::reference_wrapper 和简单指针的区别?)
常量之间的区别.指针和引用?Difference between const. pointer and reference?(常量之间的区别.指针和引用?)
c++ - 如何从指向向量的指针访问向量的内容?How to access the contents of a vector from a pointer to the vector in C++?(c++ - 如何从指向向量的指针访问向量的内容?)
*& 的含义和**&在 C++ 中Meaning of *amp; and **amp; in C++(*amp; 的含义和**amp;在 C++ 中)
为什么我不能对普通变量进行多态?Why can#39;t I do polymorphism with normal variables?(为什么我不能对普通变量进行多态?)
取消引用已删除的指针总是会导致访问冲突?Dereferencing deleted pointers always result in an Access Violation?(取消引用已删除的指针总是会导致访问冲突?)