[aspectc-user] gcc 2.96 vs. ResultBuffer

Timothy Stack stack at cs.utah.edu
Fri Mar 16 05:04:37 CET 2007


On Mar 13, 2007, at 6:41 PM, Olaf Spinczyk wrote:

> Hi Timothy,

Hi,

> could you try replace "&result" with "&result._data" in the generated
> code and see if it compiles and works as expected? I don't have a g++
> 2.96 to test this at the moment, because I am currently attending the
> AOSD conference.

I made the change in the generated code and it seemed to work.  I had
to remove 'AnyResultBuffer' and turn the operator new and delete
functions into templates to get it to work:

   template <typename T> struct ResultBuffer {
     char _data[sizeof (T)];
     ~ResultBuffer () { ((T*)_data)->T::~T(); }
     operator T& () const { return *(T*)_data; }
   };

   template <typename T>
   inline void * operator new (size_t, AC::ResultBuffer<T> *p)  
{ return p->_data; }
   template <typename T>
   inline void operator delete (void *, AC::ResultBuffer<T> *) { } //  
for VC++

I don't know if this would affect other parts of the code or other  
compilers
though...

> Best regards,
>
> Olaf

thanks,

tim



More information about the aspectc-user mailing list