discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] buffer allocation


From: Eric Blossom
Subject: Re: [Discuss-gnuradio] buffer allocation
Date: Sat, 20 Aug 2005 15:21:23 -0700
User-agent: Mutt/1.5.6i

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]