]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Rename a alloconly mempool helper function to make its scope obvious
authorJosef 'Jeff' Sipek <jeff.sipek@dovecot.fi>
Wed, 20 Jun 2018 14:35:15 +0000 (10:35 -0400)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 4 Jul 2018 08:28:51 +0000 (08:28 +0000)
pool_try_grow() makes it look like it is part of the mempool API, even
though it is an internal helper specific to the alloconly pool.

src/lib/mempool-alloconly.c

index 20b1508f6f886890aab67bfd5f588ee266d7ba31..4e1b522979a85abf261e6e876bcc958d3d5e56c8 100644 (file)
@@ -420,7 +420,7 @@ static void pool_alloconly_free(pool_t pool, void *mem)
        }
 }
 
-static bool pool_try_grow(struct alloconly_pool *apool, void *mem, size_t size)
+static bool pool_alloconly_try_grow(struct alloconly_pool *apool, void *mem, size_t size)
 {
        /* see if we want to grow the memory we allocated last */
        if (POOL_BLOCK_DATA(apool->block) +
@@ -457,7 +457,7 @@ static void *pool_alloconly_realloc(pool_t pool, void *mem,
        new_size = MEM_ALIGN(new_size);
 
        /* see if we can directly grow it */
-       if (!pool_try_grow(apool, mem, new_size)) {
+       if (!pool_alloconly_try_grow(apool, mem, new_size)) {
                /* slow way - allocate + copy */
                new_mem = pool_alloconly_malloc(pool, new_size);
                memcpy(new_mem, mem, old_size);