🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2.programmer.misc
Article #161

Re: DosSubFreeMem(): Coalesces Contiguous Blocks?

#161
From: Thierry de Montaudry
Date: Fri, 17 May 1996 00:00
26 lines
1604 bytes
In <4ndid4$d0m@cpcug.org>, kbennett@cpcug.org (Keith Bennett) writes:
>This message pertains to DosSubFreeMem() and related functions.
>
>When it frees a block, does it join together contiguous free areas of
>memory?
>
>We're getting a problem where we're running out of memory prematurely.
>
>In general, is the algorithm for allocating and freeing fairly
>intelligent?
>
As much as I've used it, the best way to use DosSub... function is to allocate
a big memory buffer (more than one meg) as uncommited memory, and let
DosSub... functions manage it. What ever you allocate will be commited as it
is needed. As far as I know, if you free a memory a block, the function won't
shrink any memory (it cannot change the address of the already allocated
blocks), but it will uncommit blocks of memory that are not in use
anymore (if you used DosSetMem with the option DOSSUB_SPARSE_OBJ).

	Thierry

/------------------------------
Thierry de Montaudry
thierry@absa.co.za
thierry@solo.pipex.co.za
Technical Details
Message-ID: <4nhukt$13t@hermes.is.co.za>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <4ndid4$d0m@cpcug.org>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cd94,6c0359dbabf01d83
X-Google-Attributes: gid10cd94,public
X-Google-Thread: 11307a,6c0359dbabf01d83
X-Google-Attributes: gid11307a,public
From: thierry@absa.co.za  (Thierry de Montaudry)
Subject: Re: DosSubFreeMem(): Coalesces Contiguous Blocks?
Date: 1996/05/17
Message-ID: <4nhukt$13t@hermes.is.co.za>
X-Deja-AN: 155303519
references: <4ndid4$d0m@cpcug.org>
organization: No organisation supplied
reply-to: thierry@absa.co.za (Thierry de Montaudry)
newsgroups: comp.os.os2.programmer.misc,bit.listserv.os2-l