igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] error.c:125: failed assertion `no<100'


From: Gábor Csárdi
Subject: Re: [igraph] error.c:125: failed assertion `no<100'
Date: Thu, 18 Jun 2009 13:43:07 +0200

Yeah, so just for the records: if you put anything on the FINALLY stack (i.e. you do the allocation with some macro having 'FINALLy' in its name), you should remove it when you don't need it any more.

The FINALLY stack is small, 100 elements. If you want to put many things on it, then create a function that can deallocate them at once and put that on the FINALLY stack.

Gabor

On Thu, Jun 18, 2009 at 7:55 AM, <address@hidden> wrote:
Sorry, solved already.
Thanks

On 16 Jun 2009, at 19:08, address@hidden wrote:

Hi,
I'm currently building my own interface to igraph.
But after building some 100 Graphs it crashes with
error.c:125: failed assertion `no<100'

I probably forget to clean something but I have no idea what?
Functions for creating and destroying the graphs are included.
The only thing special is that I store for every node a name.

Or can I figure somehow out the size of the stack (or increase it).

Therefor I defined my own struct:
typedef struct {
 igraph_t * graph;
 igraph_trie_t * names;

} yap_igraph_t;

Construction code:
 yap_igraph_t * ygraph=malloc(sizeof(yap_igraph_t));
 ygraph->graph=malloc(sizeof(igraph_t));
 igraph_t * graph= ygraph->graph;
 //printf("%p \n ",ygraph);

 igraph_vector_t * v1 = malloc(sizeof(igraph_vector_t));
 igraph_vector_init(v1, 0);
 igraph_create(graph, v1, 0, IGRAPH_UNDIRECTED);
 igraph_vector_destroy(v1);

 ygraph->names=malloc(sizeof(igraph_trie_t));
 //I also do not  sure, why I need the next to lines both. But without it doesnt work
 igraph_trie_init(ygraph->names,0);
 IGRAPH_TRIE_INIT_FINALLY(ygraph->names,TRUE);

Destruction code:
 igraph_trie_destroy(ygraph->names);
 igraph_destroy(ygraph->graph);
 igraph_free(ygraph->names);
 igraph_free(ygraph->graph);
 free(ygraph);


Thanks in advance




_______________________________________________
igraph-help mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/igraph-help



_______________________________________________
igraph-help mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/igraph-help



--
Gabor Csardi <address@hidden>     UNIL DGM


reply via email to

[Prev in Thread] Current Thread [Next in Thread]