> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of
> maintainer freedospg
> Sent: Friday, February 27, 2004 2:43 AM
> To: [EMAIL PROTECTED]
> Subject: [Freedos-devel] Make a program slimmer
>
>
> Hi,
>
> I want to know if there is a way to release memory
> from the unused heap to the OS when I shell out?
> PG runtime takes up 80K, but it needs about 40K.
> I managed to move the stack down to a designated
> address,
> but memory was not released.
> Turbo C 2.01, small model.
> Can somebody help?

With turbo C there's no need to move the stack. To resize the program's
memory simply change the _stklen and _heaplen variables.
For example, if you know it'll need only 4K of stack, set _stklen = 4 *
1024;
Or, if you know it'll not use more than 20K of heap, set _heaplen = 20 *
1024;
The Turbo C library, for small memory model programs, resizes automatically
the memory image at startup according to the two variables _heaplen and
_stklen.

Ciao



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Freedos-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to