Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Pointer (computer programming)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Architectural roots== Pointers are a very thin [[Abstraction (computer science)|abstraction]] on top of the addressing capabilities provided by most modern [[Software architecture|architecture]]s. In the simplest scheme, an ''[[Memory address|address]]'', or a numeric [[Array data structure|index]], is assigned to each unit of memory in the system, where the unit is typically either a [[byte]] or a [[Word (computer architecture)|word]] β depending on whether the architecture is [[Byte addressing|byte-addressable]] or [[word-addressable]] β effectively transforming all of memory into a very large [[Array data structure|array]]. The system would then also provide an operation to retrieve the value stored in the memory unit at a given address (usually utilizing the machine's [[general-purpose register]]s). In the usual case, a pointer is large enough to hold more addresses than there are units of memory in the system. This introduces the possibility that a program may attempt to access an address which corresponds to no unit of memory, either because not enough memory is installed (i.e. beyond the range of available memory) or the architecture does not support such addresses. The first case may, in certain platforms such as the [[x86|Intel x86]] architecture, be called a [[segmentation fault]] (segfault). The second case is possible in the current implementation of [[x86-64|AMD64]], where pointers are 64 bit long and addresses only extend to 48 bits. Pointers must conform to certain rules (canonical addresses), so if a non-canonical pointer is dereferenced, the processor raises a [[general protection fault]]. On the other hand, some systems have more units of memory than there are addresses. In this case, a more complex scheme such as [[memory segmentation]] or [[paging]] is employed to use different parts of the memory at different times. The last incarnations of the x86 architecture support up to 36 bits of physical memory addresses, which were mapped to the 32-bit linear address space through the [[Physical Address Extension|PAE]] paging mechanism. Thus, only 1/16 of the possible total memory may be accessed at a time. Another example in the same computer family was the 16-bit [[protected mode]] of the [[Intel 80286|80286]] processor, which, though supporting only 16 MB of physical memory, could access up to 1 GB of virtual memory, but the combination of 16-bit address and segment registers made accessing more than 64 KB in one data structure cumbersome. In order to provide a consistent interface, some architectures provide [[memory-mapped I/O]], which allows some addresses to refer to units of memory while others refer to device registers of other devices in the computer. There are analogous concepts such as file offsets, array indices, and remote object references that serve some of the same purposes as addresses for other types of objects.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)