TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Peter Fitzsimmons
from: jari laaksonen
date: 1995-01-25 19:50:08
subject: DosSetMem

> If your only purpose is to commit pages just before you use them, but
> never to decommit any pages once they are commited,  there is no
> reason to use this function

> Where DosSetMem() would come in handy is if you are allocating a very
> large object,  but only plan on having a few pages committed at any
> one time.

I'm writing a file & text search program which stores search results in
a structure which sometimes might be smaller, sometimes very huge. When the
program starts I allocate 2 MB of uncommitted memory and when search
proceeds I commit more memory using the same method as in the sample in my
earlier post. Before every search begins I decommit the memory, so I think
I'm using this function "right way".

>  Hint:  use it in an exception handler (OS/2 exception, not C++ exception).

Do you have any short examples of that?

        // Albert  (Team OS/2)         email: albert{at}sci.fi
                                              jla{at}to.icl.fi (work)

---
* Origin: Albert's Point/2 in Finland, Europe (2:221/360.20)
SEEN-BY: 12/2442 620/243 624/50 632/348 640/820 690/660 711/409 410 413 430
SEEN-BY: 711/807 808 809 934 942 949 955 712/515 713/888 800/1 7877/2809
@PATH: 221/360 0 220/841 201/2104 109/347 2 7 3615/50 105/103 42 724/13 600/500
@PATH: 600/2 82 229/2 12/2442 711/409 808 809 934

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™.