[Freeciv-Dev] Re: OO model for Freeciv?
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
> But I can't let a statement that that strcat call is more efficient than
> the C++ construct pass :) ) )
Sorry for not making myself clear. What I am trying to say is:
with the convenience, a programmer writes:
{
char *s = (char *)malloc(81);
s[read(file, s, 80)] = '\0';
s += '.';
}
instead of:
{
int x; char *s = (char *)malloc(82);
x = read(file, s, 80);
s[x] = '.'; s[x+1] = '\0';
}
I hope this not another bad example of mine :)
s = strcat((char *)realloc(s , strlen(s) + 2), ".");
is just the shortest generic way of doing s += '.';
It is not efficient at all. As for myself,
I always iterate through "gcc -O3 -S -o -" for crtical codes.
Regards,
I.Q.
______________________________________________
FREE Personalized Email at Mail.com
Sign up at http://www.mail.com/?sr=signup
- [Freeciv-Dev] Re: OO model for Freeciv?, David Pfitzner, 2000/05/01
- [Freeciv-Dev] Re: OO model for Freeciv?, Jules Bean, 2000/05/01
- [Freeciv-Dev] Re: OO model for Freeciv?, Tony Stuckey, 2000/05/01
- [Freeciv-Dev] Re: OO model for Freeciv?, Florian Klein, 2000/05/01
- [Freeciv-Dev] Re: OO model for Freeciv?, 蔡恆華, 2000/05/01
- [Freeciv-Dev] Re: OO model for Freeciv?, 蔡恆華, 2000/05/01
- [Freeciv-Dev] Re: OO model for Freeciv?,
蔡恆華 <=
- [Freeciv-Dev] Re: OO model for Freeciv?, Peter Schaefer, 2000/05/02
- [Freeciv-Dev] Re: OO model for Freeciv?, Peter Schaefer, 2000/05/02
- [Freeciv-Dev] Re: OO model for Freeciv?, Dan Ward, 2000/05/02
|
|