Skip to contentSkip to conversation

memory management

DISCUSSION Michael Geis 2 participants 2 messages Dec 14, 2004

lore
Share & tools
lore
#0 lore raw

I am not really familiar with memory mangement and would like to ensure I am getting memory leaks in my ALSA app. There are snd_seq_...._free functions for most of the data types I am using. For a few of them, however, I could not find a function that frees the structure and wanted to ask whether they require to be freed and I just missed the appropriate
function when looking through the header files.
The data types in question are:
snd_seq_real_time_t , snd_seq_tick_time_t, snd_seq_addr_t, snd_seq_port_subscribe_t

Could someone comment on whether the memory of variables of these data types needs to be freed?
Thanks a lot in advance,

Michael

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

#1 lore raw
Quoted 2 lines · Michael Geis

I am not really familiar with memory mangement and would like to ensure I am getting memory leaks in my ALSA app.

This is easy, just avoid any _free() calls. SCNR. ;-)

Quoted 2 lines

There are snd_seq_...._free functions for most of the data types I am using.

Those are for datatypes that are internal alsa-lib types and that can only be accessed through wrapper functions. The three ways to use such types are:
* use ..._alloc and ..._free;
* use ..._alloca to be freed when the current function exits;
* use ..._sizeof and use your own (de)allocation functions.

Quoted 7 lines

For a few of them, however, I could not find a function that frees the structure and wanted to ask whether they require to be freed and I just missed the appropriate function when looking through the header files.

The data types in question are: snd_seq_real_time_t , snd_seq_tick_time_t, snd_seq_addr_t, snd_seq_port_subscribe_t

These types are defined in the header files (and will never change).

Quoted 2 lines

Could someone comment on whether the memory of variables of these data types needs to be freed?

There is no cleanup function. Use them like any other POD type.

HTH
Clemens

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/