Re: g_utf8_offset_to_pointer() optimization



On 11/2/05, Luis Menina <liberforce fr st> wrote:
> Hanns version is 1.2s on my system, so it blows my best version (3.45s),
> but he doesn't handle endianness... waiting to see the overhead it will
> bring...

Endianess fixes will not cause run-time slowdown -- the constants will just
have to be different.

The code, however, suffers from multiple problems:

* Endianess issues.
* Assumes pointer to different types are laid out in memory the same way.
* Assumes that a character pointer that has been cast (in this case by way of
  that union) to a guint32 pointer can be dereferenced.
* Assumes that guin32 is an efficient size to operate on.

M.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]