TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: IVAN TODOROSKI
from: Herbert Rosenau
date: 1999-01-05 10:05:00
subject: Some weird addressing...

Hi IVAN,

 you wrote at 02.01.99  00:38 to HERBERT ROSENAU:

 IT>   I think that you might have mistaken the descriptors for page
 IT> table   entries. Descriptors can describe memory chunks of any
 IT> size up to 4GB   (well almost any size, because of granularity
 IT> issues), while page   table entries can describe only fixed 4KB
 IT> chunks of memory.

I'd have not acceess to the Red Books of OS/2 in the moment. So I must
remember the contens. The IBM Toolkit for WARP4 is is in its deeph of
description not at that level we're discuss here. 

You'll hava at any time the avaibility to change the behavior of each
memory page you own:

With DosSetmem() you can change:

- (de)commit a page to hold it in memory/swapper
  you can not decommit a shared page
- make a page executable
- set a page writeable
- set a page readable (yes it's possible to have a page writeonly)
- make/unmake guard pages. (only private memory)

For that each page has its own descriptor the processor is looking for.
Each page has its own usage counter, age,... but this information is not
accessable by applications.

For 32 bit processes LDT and GDT are not existent! To have this you must
allocate tiled memory. This kind of memory is accessable by 16 bit code and
has therfore LDT and GDT.

All pages you're use must be commited. But you can allocate continous
addressspace uncommitted und commit single pages you'll use them realy.
Only commited pages are real in (virtual) memory. So if your application
uses sometimes a big lot of memory but you know at allocation time not the
right amout of it you chould allocate the whole big block and
commit/decommit each page you will really use separatly. This technique
will save extreme swap orgies.

To become countinuous memory you must allocate 1 page object in required
size. Multiple allocations my give you the memeory required but *NOT*
continous! To address a member of an vector (such as a hashtable entry) you
must have a memory object that its in its size. You can't collect memory
allocated in some different calls to DosAllocmem() to become this behavior.

Quote from 'control program programming guide and reference':

Applications are not limited to a singele large allocation of memory -
other memory allocations can be made as neccessary during execution - but
large allocations and small commitments or suballocations are the most
efficient way to manage memory.

Tschau/Bye

Herbert


--- Sqed/32 1.14/development  1:
* Origin: TITANIC .. HINDENBURG .. CHALLENGER .. WIN95 (2:2476/493)
SEEN-BY: 396/1 632/0 371 633/260 262 267 270 371 635/444 506 728 639/252
SEEN-BY: 670/218
@PATH: 2476/493 480 2410/200 2432/200 2433/1200 225 270/101 396/1 633/260
@PATH: 635/506 728 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.