TH> I am using dynamic allocation.
TH> I can't allocate more than 16,384 elements in my heap
TH> using small, compact, nor large model. I thought I should
TH> be able to get 32,000, but I'm not able to.
TH> Any comments?
You're in the Borland IDE, aren't you? :)
Try running the following, once in the IDE, and then from
the command line. Understandably, you would want to use
type huge pointers under DOS and Borland for an allocation
of this size, since it is greater than 64K, and the dread
far pointer wrapping would rear it's ugly head.
I hope this helps some...
/*_|_| HUGENEW.CPP PUBLIC DOMAIN Kurt Kuzba (3/8/1998)*/
#include
#include
int main(void)
{
long double *testheap = new long double[32767];
char *TextBuffer = (char*)testheap;
cout << (TextBuffer ? "327670 bytes allocated." :
"Allocation error.") << endl;
if(!TextBuffer)
delete []testheap;
getch();
return 0;
}
> ] Being in the moment is all that there is....................
---
---------------
* Origin: *YOPS ]I[* 8.4 GIG * RA/FD/FE * Milwaukee, WI (1:154/750)
|