puzzle about source code src/misc/block.c
Posted: 14 Mar 2006 07:49
vlc-0.8.4a
file: src/misc/block.c
see the red italic ,line 154:
-----------------------------
block_fifo_t *__block_FifoNew( vlc_object_t *p_obj )
{
block_fifo_t *p_fifo;
p_fifo = malloc( sizeof( vlc_object_t ) );
vlc_mutex_init( p_obj, &p_fifo->lock );
vlc_cond_init( p_obj, &p_fifo->wait );
p_fifo->i_depth = p_fifo->i_size = 0;
p_fifo->p_first = NULL;
p_fifo->pp_last = &p_fifo->p_first;
return p_fifo;
}
-----------------------------
why malloc a 'vlc_object_t ' structure ?
with regards
file: src/misc/block.c
see the red italic ,line 154:
-----------------------------
block_fifo_t *__block_FifoNew( vlc_object_t *p_obj )
{
block_fifo_t *p_fifo;
p_fifo = malloc( sizeof( vlc_object_t ) );
vlc_mutex_init( p_obj, &p_fifo->lock );
vlc_cond_init( p_obj, &p_fifo->wait );
p_fifo->i_depth = p_fifo->i_size = 0;
p_fifo->p_first = NULL;
p_fifo->pp_last = &p_fifo->p_first;
return p_fifo;
}
-----------------------------
why malloc a 'vlc_object_t ' structure ?
with regards