Forums > Dev

Really weird behavior with array length


Jun 14 2011 | 7:56 pm

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.

Jun 16 2011 | 4:25 pm

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.

Viewing 2 posts - 1 through 2 (of 2 total)

Forums > Dev