[Freeswitch-dev] memory pool

Anthony Minessale anthony.minessale at gmail.com
Mon Oct 3 17:39:52 MSD 2011

On Mon, Oct 3, 2011 at 7:24 AM, succer110 at tiscali.it
<succer110 at tiscali.it> wrote:
> Hi! I'm a new fs module developer :)
> In the page "authoring freeswitch module" i read that "there's still times
> when using traditional C memory management is a better plan."
> How can i recognize that cases?

If you do not have a well-defined lifecycle of an object or need
several temporary allocations repeatedly its better to use malloc.
Pools are best used when you can create and destroy the pool regularly
based on the workflow of you application such as a main object
representing an handle etc.

Anything using a session can also use the session's pool.

> From what i have understood using memory pool from apr i can forget to call
> switch_core_destroy_memory_pool unless i specifically want it. Am i Right?
> Is possibile to specify the dimension of the memory pool i want to create?
> Which is the standard dimension?
> Thankyou =)

The pools auto-size themselves and do not support freeing any
allocated data.  The whole pool must be destroyed.

> E' nata indoona: chiama, videochiama e messaggia Gratis.
> Scarica indoona per iPhone, Android e PC
> _______________________________________________
> Join us at ClueCon 2011, Aug 9-11, Chicago
> http://www.cluecon.com 877-7-4ACLUE
> FreeSWITCH-dev mailing list
> FreeSWITCH-dev at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
> http://www.freeswitch.org

Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire

AIM: anthm
MSN:anthony_minessale at hotmail.com
GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888 at conference.freeswitch.org
googletalk:conf+888 at conference.freeswitch.org

Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-dev mailing list