Andy Ross writes:

 > I'm not sure that there's a good answer here.  We could consider
 > "interning" constant strings like property paths into constant
 > references that don't need allocation.  But stuff like
 > getStringValue() is always going to have to allocate a new string if
 > we want to do this robustly.

Actually, the trick is an old one from my C days that I've used a lot
in Java (yes, even Java).  Something like this would be 100% robust
and still very efficient:

  char * getStringValue (char * buf, int max_length_)

The only problem is that it adds extra work for the caller by forcing
her to supply a buffer.


All the best,


David

-- 
David Megginson, [EMAIL PROTECTED], http://www.megginson.com/

_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to