Really weird behavior with array length

Jun 14, 2011 at 7:56pm

Really weird behavior with array length

I’m using a lookup table in a filter object to cache a tan calculation. I’m using #define OMEGA_SIZE 2048 to set the table size.

Here’s where it gets weird: if I use 4096 for OMEGA_SIZE it will crash every time on creating the object giving this message EXC_BAD_ACCESS (SIGBUS). 8192, however works fine(!).

I’ve tried noargs constructors vs args constructors, and my code is very close to known good tutorial code, but I always get the same error message, and that’s the only thing that changes between the object working and not working. (and I’ve experienced this in another object of mine as well)

Any thoughts? I’m on OSX 10.5 using GCC4 and XCode 3.

#57613
Jun 16, 2011 at 4:25pm

Okay, did some checking. This only happens if I’m doing the array initialization in the new method. Moved it to dsp and all is well.

#206506

You must be logged in to reply to this topic.