<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
The question is : which pool should I use for each different thing I am
trying to accomplish?<br>
<br>
For instance the code below is part of my mod_radius_cdr
experimentation.<br>
When I am making use of a pool within a module should I :<br>
<br>
a) create a new pool?<br>
b) make use of an existing one?<br>
c) what kind of pool should I use?<br>
d) is it really just one pool (accessed through different handlers) and
I am making myself look like a fool so far?<br>
<br>
<br>
<br>
<br>
<br>
Michael Jerris wrote:
<blockquote cite="mid:2EDFD0BF-7767-42C2-8B09-48A75B0B2F08@jerris.com"
type="cite">
<pre wrap="">I am not sure even after re-reading what your question is, could you
try to rephrase?
Mike
On Jan 29, 2009, at 8:00 AM, Apostolos Pantsiopoulos wrote:
</pre>
<blockquote type="cite">
<pre wrap="">I found it out by myself!
(why is it that we always come with the solution right after posting
to
the list?)
I inserted :
thread_params = switch_core_session_alloc(session,
sizeof(*thread_params));
before the pool initialization.
But still, can I get some answers to the questions bellow about
how to effectively handle memory allocations?
Apostolos Pantsiopoulos wrote:
</pre>
<blockquote type="cite">
<pre wrap="">I have the code below :
struct radacct_thread_handle {
switch_core_session_t *session;
switch_mutex_t *mutex;
switch_thread_cond_t *cond;
};
static switch_status_t my_on_routing(switch_core_session_t *session){
switch_thread_t *thread;
switch_threadattr_t *thd_attr = NULL;
switch_memory_pool_t *pool;
struct radacct_thread_handle *thread_params = NULL;
pool = switch_core_session_get_pool(session);
thread_params->session = session;
...
}
when the program reaches the last line (thread_params->session =
session;)
I get a core dump. Is this a memory allocation error? Is it because
I am
making
use of the wrong pool? Please enlighten me because I am not an
experienced c
programmer, and I am struggling to get familiar with the FS API.
</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->
_______________________________________________
Freeswitch-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Freeswitch-dev@lists.freeswitch.org">Freeswitch-dev@lists.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a>
UNSUBSCRIBE:<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/options/freeswitch-dev">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a>
<a class="moz-txt-link-freetext" href="http://www.freeswitch.org">http://www.freeswitch.org</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
-------------------------------------------
Apostolos Pantsiopoulos
Kinetix Tele.com R & D
email: <a class="moz-txt-link-abbreviated" href="mailto:regs@kinetix.gr">regs@kinetix.gr</a>
------------------------------------------- </pre>
</body>
</html>