This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Using GCC for "real-time" compilation in audio engine development


torgshen wrote:

> > In other words, you're looking at dynamic synthesis of C code, to be
> > compiled into .so's in the background, and then loaded into a running
> > application.
> 
> Yes, only I was hoping to avoid going via C, and rather go directly to
> the internal tree representation of GCC.

I am pretty sure you will find that this is not very productive way to
go.  For one thing, AFAIK there is no tree importing capability in gcc
now.  For another, the fraction of time taken by the C front-end to
generate the trees is so small compared to the backend work that you
might as well generate a portable standard language.


> > Complications include designing the passing of
> > data and control across the boundary between the core application and
> > the synthesized code;
> 
> I was thinking about just calling the .so code with a pointer to some
> allocated memory, and the size of it, then when it returns dump the
> buffer to the soundcard (or other output). Doesn't sound complicated so
> far, but I might be missing something.
> [...]

Sure, if you can consider the synthesized code as a leaf subroutine,
and you exchange plain buffers, it is fine.  If the synthesized code
has to call back into the application for some reason (say, to fetch
more sound samples or to report an error), you'll have to be careful.


- FChE


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]