[PD-cvs] pd/src m_sched.c,1.5.4.4,1.5.4.5
Tim Blechmann
timblech at users.sourceforge.net
Wed Nov 24 17:28:37 CET 2004
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19325
Modified Files:
Tag: devel_0_38
m_sched.c
Log Message:
modified callback freeing
Index: m_sched.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/m_sched.c,v
retrieving revision 1.5.4.4
retrieving revision 1.5.4.5
diff -C2 -d -r1.5.4.4 -r1.5.4.5
*** m_sched.c 23 Nov 2004 23:07:40 -0000 1.5.4.4
--- m_sched.c 24 Nov 2004 16:28:34 -0000 1.5.4.5
***************
*** 621,628 ****
#if 1
! /* linked list of callbacks */
typedef struct _sched_callback
{
! void (*function) (t_int** argv);
t_int** argv;
t_int argc;
--- 621,629 ----
#if 1
! /* linked list of callbacks
! * callback will be freed after returning 0 */
typedef struct _sched_callback
{
! t_int (*function) (t_int** argv);
t_int** argv;
t_int argc;
***************
*** 634,638 ****
static volatile t_sched_callback * cb_fifo_end = NULL;
! void set_callback(void (*callback) (t_int** argv), t_int** argv, t_int argc)
{
t_sched_callback* new = (t_sched_callback*) getbytes
--- 635,639 ----
static volatile t_sched_callback * cb_fifo_end = NULL;
! void set_callback(t_int (*callback) (t_int** argv), t_int** argv, t_int argc)
{
t_sched_callback* new = (t_sched_callback*) getbytes
***************
*** 666,679 ****
do
{
! t_sched_callback* next = cb_fifo_begin->next;
! cb_fifo_begin->function(cb_fifo_begin->argv);
!
!
! freebytes (cb_fifo_begin->argv, cb_fifo_begin->argc);
! freebytes ((void*)cb_fifo_begin, sizeof(t_sched_callback));
!
! cb_fifo_begin = next;
}
! while ( sys_getrealtime() > stop);
return 0; /* don't sleep */
--- 667,681 ----
do
{
! if (cb_fifo_begin->function(cb_fifo_begin->argv) == 0)
! {
! t_sched_callback* next = cb_fifo_begin->next;
!
! freebytes (cb_fifo_begin->argv, cb_fifo_begin->argc);
! freebytes ((void*)cb_fifo_begin, sizeof(t_sched_callback));
!
! cb_fifo_begin = next;
! }
}
! while ( sys_getrealtime() > stop && cb_fifo_begin);
return 0; /* don't sleep */
More information about the Pd-cvs
mailing list