Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » How to handle a lack of memory
How to handle a lack of memory [message #46272] Wed, 06 April 2016 10:47 Go to previous message
koldo is currently offline  koldo
Messages: 3357
Registered: August 2008
Senior Veteran
Hello all

Now String::Cat() as many U++ functions calls SysAllocRaw() to allocate a String.

However if requested size is too big, SysAllocRaw() unconditionally shows a panic message and stops the program.

I propose you to throw an exception in this case, so that the main program can handle this properly.

In the old days we did this Smile :
char *a = malloc(size);
if (a == 0) {
	printf("\nNot enough memory available");
	... code that handles this properly ...
	... program can follow running without crashing ...
}


Best regards
IƱaki
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Please help! New transfer semantic issue!
Next Topic: [FIXED] ToUpper, ToLower,and ToAscii (char*, int) causes AssertFailed
Goto Forum:
  


Current Time: Sun Apr 28 04:31:20 CEST 2024

Total time taken to generate the page: 0.05206 seconds