Re: Changing macros to functions



On Fri, 2002-03-01 at 17:03, Michael Meeks wrote:
> Hi Murray,
> 
> On Thu, 2002-02-28 at 15:06, Murray Cumming wrote:
> > ORBit2 generates *_alloc() code like this:
> >
> > #define CORBA_sequence_CORBA_octet__alloc() ((CORBA_sequence_CORBA_octet
> > *)ORBit_small_alloc (TC_CORBA_sequence_CORBA_octet))
> 
> 	ie. you have a single stack frame, a far smaller symbol table, less
> code in icache to thrash, faster linking, and faster execution ;-)
> 
> > If this was a function instead of a macro, then I might be able to take
> > a function pointer, and thus solve this problem in the cpp branch:
> > 
> > http://lists.gnome.org/archives/orbit-list/2002-February/msg00131.html
> > 
> > Is there any chance that I'd be allowed to make that change?
> 
> 	Nope - if you need this inefficiency it can be added into the C++
> stubs, or you can simply call ORBit_small_alloc (TC_my_foo) in your C++
> binding, that would seem the best approach perhaps.

Yes, that's what I'm thinking of doing now, though I'll have to learn a
bit more about how this stuff is supposed to work. Presumably
ORBit_small_alloc isn't appropriate for all sequences.

-- 
Murray Cumming
murrayc@usa.net
www.murrayc.com




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