TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: All
from: Vadim Bugrov
date: 1996-10-30 11:27:00
subject: I couldn`t get xalloc execption.

* Crossposted ¢ SU.OS2
* Crossposted ¢ OS2PROG
* Crossposted ¢ 5049.OS2
* Crossposted ¢ KAZAN.GENERAL
* Crossposted ¢ SU.C_CPP

Hello All.

There is a program (for test only yet).
main()
{
char *c; int i=0;
try {
  while (1) {
    c=new char[100000]; i++;
    printf("allocate %d\r",i);
  }
}
catch(xalloc)
{
 printf("\nwe are reach to %d blocks\n",i);
}
}

that's all I need. First my program starts to work very fast. I see that on
screen. Next it works more slower. HDD works too. OK, I understand I reach
a virtual memory block. Next my program stops with a system error
"there are not enough memory". However I need to hadle it myself!
so:
1) How can I know if my program has got a virtual, not a physical memory?
2) Why xalloc exception do not thow to me?
my compiler is Borland C++ 2.0 for OS/2.
all compiler settings alowe exception handling.
Thank you.

Vadim

--- GoldED/386 2.50.A0611+
* Origin: H¨ªâ® ­¥ ¬®¦¥â ®¡êïâì ­¥®¡êïâ­®¥... (2:5049/11)
SEEN-BY: 50/99 270/101 620/243 625/160 711/401 409 410 413 430 808 809 934
SEEN-BY: 711/955 712/407 515 624 628 713/317 800/1
@PATH: 5049/11 1 16 5020/79 5100/8 396/1 270/101 712/515 711/808 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.