gcc iussue or ... ?

M. Warner Losh imp at bsdimp.com
Fri Apr 11 23:34:24 PDT 2003


OK.  Looks like you are creating an array of PacketReader objects.  It
looks like this array has a non-default constructor for its buffer
object (hard to tell for sure, but it appears that way).  This is
causing it to wind up in the data section.

I'm not sure why other systems aren't resulting in this.  That seems
odd to me.

Better if you hack CArray to have, instead of its LB intearnalArray[c]
a LB *internalArray and have it new/delete in its ctor/dtor.  That
likely would reduce the size a *LOT*.

template <const int c, class LB> CArray<c, LB>::CArray(std::string s):
 maxxx(c), error(0), arrayName(s), fn(NULL)
{
	internalArray = new LB[c];
}

But using a template for this is code-space wasteful since you get a
separate class generated for each size of the array that you want to
instantiate.

Warner


More information about the freebsd-hackers mailing list