[Top][All Lists]

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

Re: [igraph] C attribute handler too inefficient

From: Tamas Nepusz
Subject: Re: [igraph] C attribute handler too inefficient
Date: Tue, 17 Mar 2015 20:14:59 +0100
User-agent: Mutt/1.5.23 (2014-03-12)


Your retornaPeso() function leaks 16 bytes every time it is called:

igraph_integer_t *eid = malloc(sizeof(igraph_integer_t));

You never free this memory. For what it's worth, I don't even understand why
don't you do this instead:

igraph_integer_t eid;
igraph_bool_t error;
igraph_get_eid(g, &eid, noh_de, noh_para, 1, &error);

When an igraph function takes an igraph_whatever_t*, there is no need for you
to allocate that particular igraph_whatever_t dynamically; you can declare it
as a local variable and take its address instead.


On 03/17, Daniel Penalva wrote:
> srry, this is right now. test_final.c has the main()
> On Tue, Mar 17, 2015 at 3:23 PM, Gábor Csárdi <address@hidden>
> wrote:

reply via email to

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