After i have implemented this extreme redundancy, i tested the application on a bit broken old machine. I overclocked it, placed damaged heatstinks on it, the mainboard in that computer was broken aniway (some wires on the mainboard was deeply cutted so not any pheripherias was able to work).
![192.jpg](http://wpshrine.com/uploads/smallsc/192.jpg)
In this system, i got the folowing results:
Windows operating system: explorer.exe crashed after 40-50 minute forever.
Linux operating system: desktop applications in linux (part of kde) randomly crashed in every 2-10 minutes (gnu stability strikes again)
My application (running on windows) BEFORE the redundancy add-ons: crashed 1x from 5 start, crashed after ~20 mins of work
My application (running on windows) AFTER the redundancy add-ons: application not crashed for 5-6 hours, then windows BSOD-ed.
This app cant exit from a small electronic spike coming from the power cables, or from a confusion in the force caused by Jedis.
The show must go on aniways.
Close enough. I think my goal is reached about stability with this, but there is a thing wich cant go into my mind:
realloc.
realloc, if fails, returns null, and i started to use too much reallocs in the extended versions for now. So:
cat = (float*)realloc(cat, newsize);
if this nulls, it will destroy the cat pointer that had precious data. If malloc, i can retry it again, but not with realloc.
Is realloc destroys the memory area of cat, if it fails?
for example, if i realloc cat and put the result to a different pointer like this:
cat2 = (float*)realloc(cat, newsize);
if(!cat2) cat2 = (float*)realloc(cat, newsize);
cat=cat2;
will this help to me? I mean, will cat still store the correct data, if realloc fails?
-If not, then i may can use this code.
-If it destroys it, then i should create an own, secure realloc implementation, wich will be probably mutch slower than the built in.
-Or, maybee realloc is protected against instability? I dubt, becouse malloc is also not protected against it.
Any hints are welcome.