Re: g_malloc overhead
- From: Colomban Wendling <ban-ubuntu club-internet fr>
- To: Tor Lillqvist <tml iki fi>
- Cc: gtk-devel-list gnome org
- Subject: Re: g_malloc overhead
- Date: Thu, 29 Jan 2009 17:41:42 +0100
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Tor Lillqvist a écrit :
> The existing g_utf8_strncpy() has it meaning characters. As such I
> think the name is bit unfortunate, because of the similarity to
> strncpy() but then different semantics of the "size" parameter.
>
> --tml
I don't think it is so confusing since I think strncpy() expects ASCII
characters, and ASCII characters are obviously 1-byte sized; this is
even more true if you see there's a memcpy() function that is quite
the same as what strncpy() is. Then considering both strncpy() and
g_utf8_strncpy() takes the number of chars as the size argument fixes
confusing if using it with what it was designed for (respectively
ASCII and UTF-8).
And when computing UTF-8 strings, I think it is obvious that if
there's an utf8_* function, it does the same as the C's one does with
ASCII string, no?
Regards,
Colomban
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkmB3EYACgkQyqbACDEjVWhhFwCeNHKu1/wDCnuGwoCuHGczzFnK
1msAnRi633VAMvjhagG8+S36/P0AG1hI
=gg6h
-----END PGP SIGNATURE-----
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]