diff options
author | suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> | 2011-01-06 18:52:39 +0900 |
---|---|---|
committer | suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> | 2011-01-10 00:43:40 +0900 |
commit | 97c96f29953bd59b9efc4870e1dbe03071a9325f (patch) | |
tree | 45086bd08692b91616701603f6a98a60ee01f7f6 | |
parent | f6af979d2e5e1a6e859c8acce38849306eb23cee (diff) | |
download | freetype2-97c96f29953bd59b9efc4870e1dbe03071a9325f.tar.gz |
use basename only in the site identification in alloc limiter
-rw-r--r-- | src/base/ftdbgmem.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/base/ftdbgmem.c b/src/base/ftdbgmem.c index 1d84aae80..399cfb3c4 100644 --- a/src/base/ftdbgmem.c +++ b/src/base/ftdbgmem.c @@ -521,7 +521,7 @@ ft_mem_get_env_val_for_source( FT_MemSource source, const char* env_var_name ) { - char *file_name = (char*)source->file_name; + char *file_name = ft_basename( (char*)source->file_name ); char *c, *c0; @@ -534,7 +534,12 @@ while ( NULL != ( c = ft_strstr( c, file_name ) ) ) { /* matched token is 1st or after separator space? */ - if ( c != c0 && *(c-1) != ' ' ) + if ( c != c0 && *(c-1) != ' ' && +#ifndef macintosh + *(c-1) != '/' && *(c-1) != '\\' ) +#else + *(c-1) != ':' ) +#endif goto NextToken; /* check ':', a separator between pathname & line number */ @@ -767,7 +772,8 @@ "FT2_ALLOC_CUR_MAX_SITE" ); if ( FT_HAS_LIMITER( site ) ) FT_TRACE6(( "ft_mem_table_set() invoked by %s:%lu, limit:( ", - source->file_name, source->line_no )); + ft_basename( (char*)source->file_name ), + source->line_no )); FT_TRACE6_DEFINED_LIMIT( req_all, mem_limit_site_total ); if ( FT_HAS_MULTI_LIMITERS( site ) ) FT_TRACE6(( " && " )); @@ -785,7 +791,8 @@ { FT_TRACE6(( "ft_mem_table_set() returns NULL to %s:%lu," " allocation request exceeds %s-limit (%lu > %lu)\n", - source->file_name, source->line_no, + ft_basename( (char*)source->file_name ), + source->line_no, ( exceeds_limit_site_total ? "site-total" : "site-current" ), ( exceeds_limit_site_total ? req_all : |