remove one malloc() by making color_cache non dynamic

Change-Id: I7c71a056f79a79bfacfe64a263f1eb8476c05456
This commit is contained in:
Pascal Massimino
2012-07-16 19:13:58 -07:00
parent 8130c4cc64
commit 7f0c178e46
4 changed files with 9 additions and 15 deletions

View File

@ -35,14 +35,10 @@ int VP8LColorCacheInit(VP8LColorCache* const cc, int hash_bits) {
void VP8LColorCacheClear(VP8LColorCache* const cc) {
if (cc != NULL) {
free(cc->colors_);
cc->colors_ = NULL;
}
}
void VP8LColorCacheDelete(VP8LColorCache* const cc) {
VP8LColorCacheClear(cc);
free(cc);
}
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif

View File

@ -56,12 +56,9 @@ static WEBP_INLINE int VP8LColorCacheContains(const VP8LColorCache* const cc,
// Returns false in case of memory error.
int VP8LColorCacheInit(VP8LColorCache* const color_cache, int hash_bits);
// Delete the color cache.
// Delete the memory associated to color cache.
void VP8LColorCacheClear(VP8LColorCache* const color_cache);
// Delete the color_cache object.
void VP8LColorCacheDelete(VP8LColorCache* const color_cache);
//------------------------------------------------------------------------------
#if defined(__cplusplus) || defined(c_plusplus)