comparison mcabber/libjabber/pool.c @ 1558:3df441efb7c2

Fix gcc warnings related to inline/static uses
author Mikael Berthe <mikael@lilotux.net>
date Fri, 10 Oct 2008 20:29:15 +0200
parents c3ae9251c197
children
comparison
equal deleted inserted replaced
1557:31422cb73356 1558:3df441efb7c2
59 #ifdef POOL_DEBUG 59 #ifdef POOL_DEBUG
60 int pool__total = 0; /**< how many memory blocks are allocated */ 60 int pool__total = 0; /**< how many memory blocks are allocated */
61 int pool__ltotal = 0; 61 int pool__ltotal = 0;
62 xht pool__disturbed = NULL; 62 xht pool__disturbed = NULL;
63 63
64 inline void *_retried__malloc(size_t size);
65
64 /** 66 /**
65 * create a new memory allocation and increment the pool__total counter 67 * create a new memory allocation and increment the pool__total counter
66 * 68 *
67 * only used if POOL_DEBUG is defined, else it is an alias for malloc 69 * only used if POOL_DEBUG is defined, else it is an alias for malloc
68 * 70 *
99 * If it still fails, we exit the process 101 * If it still fails, we exit the process
100 * 102 *
101 * @param size how many bytes of memory we allocate 103 * @param size how many bytes of memory we allocate
102 * @return pointer to the allocated memory 104 * @return pointer to the allocated memory
103 */ 105 */
104 inline void *_retried__malloc(size_t size) { 106 void *_retried__malloc(size_t size) {
105 void *allocated_memory; 107 void *allocated_memory;
106 int malloc_tries = 0; 108 int malloc_tries = 0;
107 109
108 while ((allocated_memory=_pool__malloc(size)) == NULL) { 110 while ((allocated_memory=_pool__malloc(size)) == NULL) {
109 if (malloc_tries++ > MAX_MALLOC_TRIES) { 111 if (malloc_tries++ > MAX_MALLOC_TRIES) {