Hi all,
I was wondering if someone could give me some advice on the segmentation fault I get from this piece of code:
int main(void)
{
MagickWandGenesis();
int var[2100000];
}
I think it is a memory problem because I dont get the error if I use "int var[2000000]". Anyway, it looks like 2000000 integer entries shouldnt take up much memory. How can I reduce the memory used by MagickWandGenesis (or better MagickCoreGenesis) and still being able to manipulate average size pictures?
Thank you.
Efo
Memory problem/question [SOLVED]
Memory problem/question [SOLVED]
Last edited by efo on 2008-04-23T11:20:31-07:00, edited 1 time in total.
Re: Memory problem/question
You are exceeding the stack limit of your machine/compiler. For images that large, allocate from the heap:
- int *var;
var2=(int *) malloc(2100000*sizeof(int));
Re: Memory problem/question
Thank you so much magick!!
I realize this was more of a c question, and I really appreciate you taking the time to help me out.
Thanks again.
Efo
I realize this was more of a c question, and I really appreciate you taking the time to help me out.
Thanks again.
Efo