Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: use of hex-number in references

by arthas (Hermit)
on Jun 09, 2004 at 07:46 UTC ( #362638=note: print w/replies, xml ) Need Help??


in reply to Re: use of hex-number in references
in thread use of hex-number in references

This is probably a silly questions, but my inexperience with memory management forces me to post it. ;-)

So, those references are actually pointers which map directly to system memory. However, if the systems moves around memory zones (i.e. it puts something on the swap file/partition), how can they remain valid?

Thanks, Michele.

Replies are listed 'Best First'.
Re^3: use of hex-number in references
by BrowserUk (Pope) on Jun 09, 2004 at 08:02 UTC

    The addresses programs use are virtual addresses. These are translated to real (physical) addresses by the OS and/or the CPU transparently to the program.

    The following extract from here says it better.

    Address translation

    This means the virtual addresses generated by a program are different from the physical addresses that go onto the address bus; to the memory chips. The translation of virtual addresses to physical addresses is performed by special hardware inside the CPU called a memory management unit (MMU).

    Address translation can be used for the kernel as well as the tasks. This lets you link the kernel to run at a specific address, but load the kernel anywhere in memory.

    Besides address translation, the MMU usually provides memory protection. Ranges of memory can be made to cause a page fault or general protection fault by any combination of writing to the memory range, accessing the memory range in any way (read, write, execute), access to the memory range by code running at user privilege (ring 3).


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://362638]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2019-05-23 20:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (146 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!