summaryrefslogtreecommitdiff
path: root/src/fclang.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2012-12-29 23:12:07 -0500
committerBehdad Esfahbod <behdad@behdad.org>2012-12-29 23:12:07 -0500
commitd7e1965aa0f55925913e9764d2d0792cc14490c2 (patch)
tree67e3fbf05df45b6cab7b4f64c88569d03dc0925d /src/fclang.c
parentd823bb3cad1b34d92ca99998a00f35b66666bdf3 (diff)
downloadfontconfig-d7e1965aa0f55925913e9764d2d0792cc14490c2.tar.gz
Remove memory accounting and reporting
That belongs in tools like cairo/util/malloc-stat.so
Diffstat (limited to 'src/fclang.c')
-rw-r--r--src/fclang.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/src/fclang.c b/src/fclang.c
index 57183fd..d1fadf5 100644
--- a/src/fclang.c
+++ b/src/fclang.c
@@ -182,7 +182,7 @@ FcLangNormalize (const FcChar8 *lang)
{
FcChar8 *result = NULL, *s, *orig;
char *territory, *encoding, *modifier;
- size_t llen, tlen = 0, mlen = 0, ssize;
+ size_t llen, tlen = 0, mlen = 0;
if (!lang || !*lang)
return NULL;
@@ -197,10 +197,6 @@ FcLangNormalize (const FcChar8 *lang)
s = FcStrCopy (lang);
if (!s)
goto bail;
- /* store the original length of 's' here to let FcMemFree know
- * the correct size since we breaks 's' from now on.
- */
- ssize = strlen ((const char *)s) + 1;
/* from the comments in glibc:
*
@@ -289,8 +285,6 @@ FcLangNormalize (const FcChar8 *lang)
/* we'll miss the opportunity to reduce the correct size
* of the allocated memory for the string after that.
*/
- FcMemFree (FC_MEM_STRING, ssize);
- FcMemAlloc (FC_MEM_STRING, strlen((const char *)s) + 1);
s = NULL;
goto bail1;
}
@@ -307,8 +301,6 @@ FcLangNormalize (const FcChar8 *lang)
/* we'll miss the opportunity to reduce the correct size
* of the allocated memory for the string after that.
*/
- FcMemFree (FC_MEM_STRING, ssize);
- FcMemAlloc (FC_MEM_STRING, strlen((const char *)s) + 1);
s = NULL;
goto bail1;
}
@@ -329,8 +321,6 @@ FcLangNormalize (const FcChar8 *lang)
/* we'll miss the opportunity to reduce the correct size
* of the allocated memory for the string after that.
*/
- FcMemFree (FC_MEM_STRING, ssize);
- FcMemAlloc (FC_MEM_STRING, strlen((const char *)s) + 1);
s = NULL;
}
bail1:
@@ -338,10 +328,7 @@ FcLangNormalize (const FcChar8 *lang)
FcStrFree (orig);
bail0:
if (s)
- {
free (s);
- FcMemFree (FC_MEM_STRING, ssize);
- }
bail:
if (FcDebug () & FC_DBG_LANGSET)
{
@@ -465,7 +452,6 @@ FcLangSetCreate (void)
ls = malloc (sizeof (FcLangSet));
if (!ls)
return 0;
- FcMemAlloc (FC_MEM_LANGSET, sizeof (FcLangSet));
memset (ls->map, '\0', sizeof (ls->map));
ls->map_size = NUM_LANG_SET_MAP;
ls->extra = 0;
@@ -477,7 +463,6 @@ FcLangSetDestroy (FcLangSet *ls)
{
if (ls->extra)
FcStrSetDestroy (ls->extra);
- FcMemFree (FC_MEM_LANGSET, sizeof (FcLangSet));
free (ls);
}