summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexei Podtelezhnikov <apodtele@gmail.com>2021-09-12 14:32:22 -0400
committerAlexei Podtelezhnikov <apodtele@gmail.com>2021-09-12 14:32:22 -0400
commit9870b6c07e2cd9f195f82aad4bccd754d70e8601 (patch)
tree2b4b1acd3c0f57ff1c2ddbf98463e86039aeddb0
parent2d57b0592805c76d676b51fbf9553de71c5a5c78 (diff)
downloadfreetype2-9870b6c07e2cd9f195f82aad4bccd754d70e8601.tar.gz
[cache] Avoid some memory zeroing.
* src/cache/ftcmru.c (FTC_MruList_New): Use Q-macro. * src/cache/ftcmanag.c (FTC_Manager_RegisterCache): Ditto. * src/cache/ftccache.c (ftc_cache_init, ftc_cache_resize): Ditto.
-rw-r--r--src/cache/ftccache.c6
-rw-r--r--src/cache/ftcmanag.c2
-rw-r--r--src/cache/ftcmru.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/src/cache/ftccache.c b/src/cache/ftccache.c
index 4c0324278..86660a41f 100644
--- a/src/cache/ftccache.c
+++ b/src/cache/ftccache.c
@@ -135,7 +135,7 @@
/* if we can't expand the array, leave immediately */
- if ( FT_RENEW_ARRAY( cache->buckets,
+ if ( FT_QRENEW_ARRAY( cache->buckets,
( mask + 1 ) * 2, ( mask + 1 ) * 4 ) )
break;
}
@@ -189,7 +189,7 @@
/* if we can't shrink the array, leave immediately */
- if ( FT_RENEW_ARRAY( cache->buckets,
+ if ( FT_QRENEW_ARRAY( cache->buckets,
( mask + 1 ) * 2, mask + 1 ) )
break;
@@ -341,7 +341,7 @@
cache->mask = FTC_HASH_INITIAL_SIZE - 1;
cache->slack = FTC_HASH_INITIAL_SIZE * FTC_HASH_MAX_LOAD;
- (void)FT_NEW_ARRAY( cache->buckets, FTC_HASH_INITIAL_SIZE * 2 );
+ (void)FT_QNEW_ARRAY( cache->buckets, FTC_HASH_INITIAL_SIZE * 2 );
return error;
}
diff --git a/src/cache/ftcmanag.c b/src/cache/ftcmanag.c
index d785513d7..b4aee40db 100644
--- a/src/cache/ftcmanag.c
+++ b/src/cache/ftcmanag.c
@@ -597,7 +597,7 @@
goto Exit;
}
- if ( !FT_ALLOC( cache, clazz->cache_size ) )
+ if ( !FT_QALLOC( cache, clazz->cache_size ) )
{
cache->manager = manager;
cache->memory = memory;
diff --git a/src/cache/ftcmru.c b/src/cache/ftcmru.c
index 1a9d8281d..2cac6f9d3 100644
--- a/src/cache/ftcmru.c
+++ b/src/cache/ftcmru.c
@@ -262,7 +262,7 @@
if ( list->clazz.node_done )
list->clazz.node_done( node, list->data );
}
- else if ( FT_ALLOC( node, list->clazz.node_size ) )
+ else if ( FT_QALLOC( node, list->clazz.node_size ) )
goto Exit;
error = list->clazz.node_init( node, key, list->data );