🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by ma853712@levels. Fri, 17 Feb 1989 13:40
How much memory left in Zortech C++???
#2589
Author: ma853712@levels.
Date: Fri, 17 Feb 1989 13:40
7 lines
170 bytes
Could anyone suggest how to determine how much heap space I've got left when
running a C++ program. I'm using Zortech C, with the large memory model.

Thanks,

Riccardo
Re: How much memory left in Zortech C++???
#2675
Author: bright@Data-IO.C
Date: Wed, 01 Mar 1989 19:16
15 lines
756 bytes
In article <1508@levels.sait.edu.au> ma853712@levels.sait.edu.au (Riccardo Macri) writes:
>Could anyone suggest how to determine how much heap space I've got left when
>running a C++ program. I'm using Zortech C, with the large memory model.

This is a complex problem, due to 3 factors:
1. There may be DOS memory blocks unallocated to the program yet.
2. The free list maintained by malloc/free may be fragmented.
3. There may be allocated DOS memory blocking the contiguous expansion
   of the heap by sbrk().

So do you want the sum of all available free memory, or the largest
individual piece that can be allocated (64k max with malloc), or the largest
number of pieces that can be allocated of size >= n? A different strategy
is required for each.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads