bmdhacks has asked for the wisdom of the Perl Monks concerning the following question:
This leaks memory. However, if I make the key be a char * and instead use hv_store it does not leak memory. So here's my question: Do I have to free up the SV* key when I'm done using it in hv_store_ent, or is some other error causing my memory leak?void add_entry(hash) HV * hash PREINIT: SV * key; SV * val; CODE: key = newSViv( (IV)someint ); val = newSViv( (IV)otherint ); hv_store_ent( hash, key, val, 0 );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: hv_store_ent
by rpc (Monk) on Jan 18, 2001 at 01:15 UTC | |
by bmdhacks (Novice) on Jan 18, 2001 at 01:46 UTC | |
|
Re: hv_store_ent
by bmdhacks (Novice) on Jan 18, 2001 at 03:09 UTC | |
by tye (Sage) on Jan 18, 2001 at 04:59 UTC | |
by bmdhacks (Novice) on Jan 21, 2001 at 03:37 UTC | |
by tilly (Archbishop) on Jan 21, 2001 at 06:55 UTC |