I
ico.bukvic
Hi all,
I've made a 2d dynamic array as follows (this is a snippet so not all
variables are accounted for):
//numvoices are dynamic (1-1000), entered by user
//MAXCHANNELS is currently defined as 24
float **gvoiceSpat;
float **notechannelGain;
float **notechannelGainSpread;
gvoiceSpat = new float *[numvoices];
notechannelGain = new float *[numvoices];
notechannelGainSpread = new float *[numvoices];
for (i = 0; i < numvoices; i++)
{
gvoiceSpat = new float[MAXCHANNELS];
notechannelGain = new float[MAXCHANNELS];
notechannelGainSpread = new float[MAXCHANNELS];
}
The interesting thing is that this code works flawlessly in gcc but in
Visual C++ (2003 .NET) whenever numvoices exceeds ~120, the program
crashes, sometimes reporting unknown exception. The problem is that
this is a code for an external module for another application and uses
additional third-party libs so it is difficult to point fingers at the
culprit. Yet, the fact remains that this crash occurs only on Windows
using Visual C++, while it works flawlessly on OSX (gcc) and Linux
(gcc) using same libs.
Any ideas as to why would this be the case?
For what it's worth, I also tried substituting these with vectors with
no difference whatsoever.
Any help is most appreciated!
Sincerely,
Ico
I've made a 2d dynamic array as follows (this is a snippet so not all
variables are accounted for):
//numvoices are dynamic (1-1000), entered by user
//MAXCHANNELS is currently defined as 24
float **gvoiceSpat;
float **notechannelGain;
float **notechannelGainSpread;
gvoiceSpat = new float *[numvoices];
notechannelGain = new float *[numvoices];
notechannelGainSpread = new float *[numvoices];
for (i = 0; i < numvoices; i++)
{
gvoiceSpat = new float[MAXCHANNELS];
notechannelGain = new float[MAXCHANNELS];
notechannelGainSpread = new float[MAXCHANNELS];
}
The interesting thing is that this code works flawlessly in gcc but in
Visual C++ (2003 .NET) whenever numvoices exceeds ~120, the program
crashes, sometimes reporting unknown exception. The problem is that
this is a code for an external module for another application and uses
additional third-party libs so it is difficult to point fingers at the
culprit. Yet, the fact remains that this crash occurs only on Windows
using Visual C++, while it works flawlessly on OSX (gcc) and Linux
(gcc) using same libs.
Any ideas as to why would this be the case?
For what it's worth, I also tried substituting these with vectors with
no difference whatsoever.
Any help is most appreciated!
Sincerely,
Ico