[Fribidi-discuss] memory allocation problems
Tomas Frydrych
tomas at frydrych.uklinux.net
Tue Nov 27 09:22:01 EST 2001
During my work on AbiWord I have discovered that the
g_mem_chunk_new allocation mechanism that is used in fribidi
appears to be incompatible with allocation by malloc, namely,
memory allocated by g_mem_chunk_new can be used in a
subsequent call to malloc.
Building fribidi without glib is at the moment problematic. For one,
there is a bug in free_rl_list which causes immediate SIGSEGV
(patch attached). Further, fribidi_mini_glib.h file defines the glib
types using typedef, which in case of an application that uses glib
and merely does not want fribidi to use it, causes problems.
Considering that all that fribidi uses from glib are the glib types,
memory routines and g_list_append, I am wondering whether the
glib dependence is more of hinderance to fribidi than anything else.
Tomas
-------------- next part --------------
--- fribidi.c Tue Nov 27 16:24:30 2001
+++ fribidi_mod.c Tue Nov 27 16:29:00 2001
@@ -1054,10 +1054,8 @@
{
TypeLink *p, *pp;
- if (!pp)
- return;
#ifdef USE_SIMPLE_MALLOC
- for (pp = type_rl_list; pp; pp = pp->next)
+ for (pp = type_rl_list; pp; pp = p)
{
p = pp->next;
g_free (pp);
More information about the FriBidi
mailing list