On Sat, Aug 20, 2005 at 03:10:05PM -0700, Ges wrote:
> Hi,
> 
> I am a bit confused about where the buffer allocation
> is taking place for each block in a flowgraph.
> 
> In flowgraph.py, the _assign_buffers() function,
> creates buffer and attaches to each block's detail. 

_assign_buffers is where the allocation takes place.

> In single threaded scheduler's main_loop() fucntion,
> vectors of DEFAULT_CAPACITY are being created, which
> are being passed to the general_work() function of
> each block. 

main_loop is creating vectors of pointers (that point into the
allocated buffers).  DEFAULT_CAPACITY doesn't really have anything to
do with anything.  The vectors of pointers are resized prior to each use.

> I am certainly missing something here or I have
> misunderstood something. Please help.
> 
> If you can give me a quick run of exactly how buffers
> are allocated for each block (code-pointers) that
> would help.

You have it right.  The buffers are assigned in
flow_graph._assign_buffers.  The buffer is allocated in
buffer_sizes.allocate:

   return buffer (nitems, item_size)

returns a python object that wraps the underlying C++ gr_buffer instance.

Eric


_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to