[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference noted::hackers_v1

Title:-={ H A C K E R S }=-
Notice:Write locked - see NOTED::HACKERS
Moderator:DIEHRD::MORRIS
Created:Thu Feb 20 1986
Last Modified:Mon Aug 03 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:680
Total number of notes:5456

426.0. "Question on mapped sections" by DVINCI::GREENFIELD () Wed Mar 11 1987 20:11

	If I map a section of my address space to a disk file, the
 memory locations are zeroed.  Is it possible for me to take
 a section of memory all filled with my data and map it to
 a file without having the mapped section call zero my data?

	Thanks

	Mike

T.RTitleUserPersonal
Name
DateLines
426.1Map the file BEFORE you fill in the memory.BISTRO::HEINIf We don't Have it,You don't Need it!Thu Mar 12 1987 06:181
    
426.2VIDEO::LEICHTERJJerry LeichterSat Mar 14 1987 14:579
I asked about this in VMSNOTES a while back; no one could come up with a way to
do it (except, of course, to map the file first).  I ended up suggesting it in
VMSPHASE0.  (The ability to do stuff like this has other advantages, though
the general case can be VERY complex to implement.  At this level, not all
memory is equal - do you want to allow me to take some memory that's part of
a global section and map it to a file, thus getting a copy?  That would
require rather different mechanisms than dealing with stuff backed by a
pagefile.)
							-- Jerry
426.3VINO::RASPUZZIMichael RaspuzziMon Mar 16 1987 14:1414
    Re .0: Gee, that's a bummer that you can't do it. TOPS-20 allows
    you to do this WITHOUT zeroing your memory contents. It also
    allows you to map a file to pages before putting stuff there.
    
    Of course, there is one bad side effect of mapping pages to a file
    after you have done wonderful things to memory - you loose the stuff
    in your process space. However, memory does get saved in the file
    so all is not lost - you can remap the file to memory.
    
    BTW, one would assume it would be more efficient to map a file to
    memory before writing to it. That way, when memory gets modified,
    so does the file.
    
    Mike