Note that there are some explanatory texts on larger screens.

plurals
  1. POCalling functions from within function(float *VeryBigArray,long SizeofArray) from within objC method fails with EXC_BAD_ACCESS
    primarykey
    data
    text
    <p>Ok I finally found the problem. It was inside the C function(CarbonTuner2) not the objC method. I was creating inside the function an array of the same size as the file size so if the filesize was big it created a really big array and my guess is that when I called another function from there, the local variables were put on the stack which created the EXC_BAD_ACCESS. What I did then is instead of using a variable to declare to size of the array I put the number directly. Then the code didnt even compile. it knew. The error wassomething like: Array size too big. I guess working 20+hours in a row isnt good XD But I am definitly gonna look into tools other than step by step debuggin to figure these ones out. Thanks for your help. Here is the code. If you divide gFileByteCount by 2 you dont get the error anymore:</p> <pre><code>// ConverterController.h # import &lt;Cocoa/Cocoa.h&gt; # import "Converter.h" @interface ConverterController : NSObject { UInt64 gFileByteCount ; } -(IBAction)ProcessFile:(id)sender; void CarbonTuner2(long numSampsToProcess, long fftFrameSize, long osamp); @end // ConverterController.m # include "ConverterController.h" @implementation ConverterController -(IBAction)ProcessFile:(id)sender{ UInt32 packets = gTotalPacketCount;//alloc a buffer of memory to hold the data read from disk. gFileByteCount=250000; long LENGTH=(long)gFileByteCount; CarbonTuner2(LENGTH,(long)8192/2, (long)4*2); } @end void CarbonTuner2(long numSampsToProcess, long fftFrameSize, long osamp) { long numFrames = numSampsToProcess / fftFrameSize * osamp; float g2DFFTworksp[numFrames+2][2 * fftFrameSize]; double hello=sin(2.345); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload