远近指针

Near and Far pointers(远近指针)
本文介绍了远近指针的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我们常用的指针(我们通常使用的指针)、近指针和远指针之间有什么区别?近指针和远指针在当今的 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 :-)

这篇关于远近指针的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

Could I ever want to access the address zero?(我可以想访问地址零吗?)
C++ Access derived class member from base class pointer(C++ 从基类指针访问派生类成员)
Weird Behaviour with const_cast(const_cast 的奇怪行为)
Are pointer variables just integers with some operators or are they quot;symbolicquot;?(指针变量只是带有某些运算符的整数还是“符号?)
Modifying a char *const string(修改 char *const 字符串)
Modifying a const int in C++(修改 C++ 中的 const int)