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 C++ in GCC is OK


On Wed, Jun 02, 2010 at 08:28:53AM +0200, Laurynas Biveinis wrote:
> See http://gcc.gnu.org/wiki/gcc-in-cxx , section "Major TODO":
> work out the details of using STL containers with GC allocated
> objects. This means teaching gengtype how to generate code to traverse
> STL containers, which would then be used during GC. This is not a task
> for the faint-hearted.
> 
> Basically we can teach gengtype to walk std::vector. But I don't see
> how we can avoid dependency in gengtype on vector internal structures
> (_M_impl) and similar, and if that would not preclude building gcc
> with 3rd party standard library (which would be a real concern).

But do we really want to use std::vector?  The vec.h, appart from
having ugly syntactic sugar, seems to be more space efficient, has better
aliasing properties (given that it is just one pointer, you can e.g. use
restrict on it easily) and seems to have more operations than std::vector has
(std::vector has 3 pointers, while vec is just one pointer + 2 unsigned
ints, I don't see counterparts to operations like VEC_quick_push or
VEC_unordered_remove).

	Jakub


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