Roland Mainz wrote: > [The following falls under the category "micro-optimisation" but may IMO > still be worth an investigation] > After working on various parts of OpenSolaris I found that is common to > use the following sequence to concatenate strings: > -- snip -- > ... > char *s; > ... > strcat(s, "foo"); > strcat(s, "/"); > strcat(s, "bar"); > -- snip -- > (note: The example is simplified, normally { "foo", ",", "bar" } are > normal strings and no static string literals) > while this code is simple and easy to understand it is quite inefficient > - |strcat()| will always walk |s| each time. If |s| already contains a > large path this will be horrible time-consuming. > > Back in the 1990 timeframe there was the "DICE C" compiler for AmigaOS > (AFAIK SAS C/C++ had something similar - but I am not sure) which solved > this issue quite cleanly via having a special version of |strcat()| > which returned the end of the string instead of the beginning (like > ANSI-C |strcat()| does) ... I don't remember the functions's name in > "DICE C" anymore - lets call it |strFOOcat()| for now...
[Seems I finally found Matthew Dillons email address...] Matthew: Do you remeber how your Amiga DICE-C compiler called the function described above ? ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) [EMAIL PROTECTED] \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 7950090 (;O/ \/ \O;) _______________________________________________ opensolaris-discuss mailing list opensolaris-discuss@opensolaris.org