[cairo] Hash rewrite #3: cairo_scaled_font_map
Carl Worth
cworth at cworth.org
Fri Aug 12 23:38:56 PDT 2005
On Thu, 11 Aug 2005 18:29:34 -0700, Keith Packard wrote:
> Looks like this doesn't distinguish between a failure to create the font
> map and a failure to create the hash table.
Good catch. I've fixed this to patch the memory leak that would be
caused if the first succeeded and the second failed.
> hash = _hash_bytes_fnv ((unsigned char *)(&scaled_font->font_matrix.xx),
> sizeof(double) * 4,
> hash);
>
> I assume you're trying to avoid incorporating the translation elements
> into the hash; a comment might make that more clear here (and the
> one with the ctm as well).
Ah, this isn't new code of mine here, just stuff getting pushed
around.
> Should we just set the translation elements to zero and hash the whole
> structure instead?
Is setting the translation elements to zero the correct thing to do?
If the intention is to ignore the translation elements, then I agree
they should be cleared and hashed. But from a quick glance, (including
the documentation of cairo_set_font_size and cairo_set_font_matrix), I
don't see anything that explicitly says the translation elements are
ignored. Owen?
> Similarly, should we just memcmp the whole key? I don't see any pointers
> in it. Or are you concerned about padding in the options structure?
One difficulty (again) is that we don't have a separate structure for
just the key anymore. Perhaps that's a defect in the new model, but
I've been claiming it as a feature since you no longer need a mostly
redundanextras/FreeType/lib/arch/debugger/CVS
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/arch/debugger/CVS/Entries
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/arch/debugger/CVS/Repository
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/arch/mac
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/arch/mac/CVS
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/arch/mac/CVS/Entries
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/arch/mac/CVS/Repository
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/arch/msdos
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/arch/msdos/CVS
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/arch/msdos/CVS/Entries
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/arch/msdos/CVS/Repository
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/arch/os2
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/arch/os2/CVS
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/arch/os2/CVS/Entries
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/arch/os2/CVS/Repository
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/arch/unix
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/arch/unix/CVS
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/arch/unix/CVS/Entries
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/arch/unix/CVS/Repository
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/arch/vms
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/arch/vms/CVS
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/arch/vms/CVS/Entries
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/arch/vms/CVS/Repository
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/arch/win16
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/arch/win16/CVS
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/arch/win16/CVS/Entries
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/arch/win16/CVS/Repository
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/arch/win32
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/arch/win32/CVS
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/arch/win32/CVS/Entries
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/arch/win32/CVS/Repository
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/CVS
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/CVS/Entries
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/CVS/Entries.Log
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/CVS/Repository
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/extend
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/extend/CVS
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/extend/CVS/Entries
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/lib/extend/CVS/Repository
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/pascal
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/pascal/CVS
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/pascal/CVS/Entries
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/pascal/CVS/Entries.Log
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/pascal/CVS/Repository
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/pascal/lib
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/pascal/lib/CVS
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/pascal/lib/CVS/Entries
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/pascal/lib/CVS/Repository
/home/srv/cvs.freedesktop.org/tmp/cvs-serv22786/extras/FreeType/pascal/test
/home/sions as in your local checkout of the repository, and not
what's at the head.
-Carl
--pgp-sign-Multipart_Fri_Aug_12_23:40:40_2005-1
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQBC/ZXo6JDdNq8qSWgRAsFYAJ9Re0MsRJWjb+FPNL0jSpSh5VAM0ACfURg9
LrDC3eSDybG1WMOJi84C9FY=
=nL5b
-----END PGP SIGNATURE-----
--pgp-sign-Multipart_Fri_Aug_12_23:40:40_2005-1--
More information about the cairo
mailing list