🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: alt.msdos.programming
1 messages
1 total messages Started by Tilo Elstner - BSI Wed, 13 Mar 1996 13:12
Help: farmalloc doesn't work
#1
Author: Tilo Elstner - BSI
Date: Wed, 13 Mar 1996 13:12
31 lines
1842 bytes
Second attempt to post this, I fear the first text stayed local only: 

Hello,

I got trouble with Borland C++ v3.1 for DOS running under OS/2 in a DOS BOX with the following piece of code:

-- snip ---
  printf("Memory avail: %li Bytes\n",farcoreleft);
  picture=(unsigned char huge*)farmalloc(483000);
  if (picture==NULL) {
    printf("Not enough memory for picture buffer #1.\n"); exit(8);
  }
  printf("Memory avail after buffer #1: %li Bytes\n",farcoreleft);
-- snap ---

Compiler setting is to "HUGE". But farmalloc (and farcalloc, too) won't get memory from the far heap (Under OS/2 with max settings around 500 MByte!). Instead it get memory from the near heap, which size is limited to size of DOS main memory. Thus a 483000 Bytes block doesn't fit, but 480000 does. I tested it under plain DOS, there are some bytes more memory available and it worked.

If farmalloc would get the DOS memory first, and then the far memory - OK, I could live with it. But unfortunately farmalloc NEVER gets any memory from my big far heap. 

Thanx,

Tels

---------------------------------------------------------------------
e-mail	  : elstner@bsi.de
fon (duty): 0228/9582-134
fax (duty): 0228/9582-450
ASM Edit  : http://www.inf.tu-dresden.de/~ok3/asmedit.html
	  : ftp://ftp.inf.tu-dresden.de/pub/ms-dos/edit/asmedit7.zip
DISCLAIMER: My oppinions are my own, not those of my employer.
---------------------------------------------------------------------
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