[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[freetype2] master 9a4c846 1/2: [cache] Revert to some zeroing.
From: |
Werner Lemberg |
Subject: |
[freetype2] master 9a4c846 1/2: [cache] Revert to some zeroing. |
Date: |
Tue, 14 Sep 2021 21:39:29 -0400 (EDT) |
branch: master
commit 9a4c846e60e0260f79ce760fe2aef06857197eff
Author: Alexei Podtelezhnikov <apodtele@gmail.com>
Commit: Alexei Podtelezhnikov <apodtele@gmail.com>
[cache] Revert to some zeroing.
* src/cache/ftccache.c (ftc_cache_init, ftc_cache_resize): Zero
`buckets` again to fix some crashes.
---
src/cache/ftccache.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/cache/ftccache.c b/src/cache/ftccache.c
index 86660a4..4bdf9b1 100644
--- a/src/cache/ftccache.c
+++ b/src/cache/ftccache.c
@@ -119,7 +119,7 @@
FT_UFast count = mask + p + 1; /* number of buckets */
- /* do we need to shrink the buckets array? */
+ /* do we need to expand the buckets array? */
if ( cache->slack < 0 )
{
FTC_Node new_list = NULL;
@@ -135,7 +135,7 @@
/* if we can't expand the array, leave immediately */
- if ( FT_QRENEW_ARRAY( cache->buckets,
+ if ( FT_RENEW_ARRAY( cache->buckets,
( mask + 1 ) * 2, ( mask + 1 ) * 4 ) )
break;
}
@@ -172,7 +172,7 @@
cache->p = p + 1;
}
- /* do we need to expand the buckets array? */
+ /* do we need to shrink the buckets array? */
else if ( cache->slack > (FT_Long)count * FTC_HASH_SUB_LOAD )
{
FT_UFast old_index = p + mask;
@@ -341,7 +341,7 @@
cache->mask = FTC_HASH_INITIAL_SIZE - 1;
cache->slack = FTC_HASH_INITIAL_SIZE * FTC_HASH_MAX_LOAD;
- (void)FT_QNEW_ARRAY( cache->buckets, FTC_HASH_INITIAL_SIZE * 2 );
+ (void)FT_NEW_ARRAY( cache->buckets, FTC_HASH_INITIAL_SIZE * 2 );
return error;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freetype2] master 9a4c846 1/2: [cache] Revert to some zeroing.,
Werner Lemberg <=