Reorganize code in secmem.c.
* src/secmem.c (pooldesc_t): New type to collect information about one pool. (pool_size): Remove. Now a member of pooldesc_t. (pool_okay): Ditto. (pool_is_mmapped): Ditto. (pool): Rename variable ... (mainpool): And change type to pooldesc_t. (ptr_into_pool_p): Add arg 'pool'. (mb_get_next): Ditto. (mb_get_prev): Ditto. (mb_merge): Ditto. (mb_get_new): Ditto. (init_pool): Ditto. (lock_pool): Rename to ... (look_pool_pages: this. (secmem_init): Rename to ... (_gcry_secmem_init_internal): this. Add local var POOL and init with address of MAINPOOL. (_gcry_secmem_malloc_internal): Add local var POOL and init with address of MAINPOOL. (_gcry_private_is_secure): Ditto. (_gcry_secmem_term): Ditto. (_gcry_secmem_dump_stats): Ditto. (_gcry_secmem_free_internal): Ditto. Remove check for NULL arg. (_gcry_secmem_free): Add check for NULL arg before taking the lock. (_gcry_secmem_realloc): Factor most code out to ... (_gcry_secmem_realloc_internal): this.
This change prepares future work to allow the use of several pools.
- Signed-off-by: Werner Koch <wk@gnupg.org>