/[svn]/branches/newio/src/mempool.c
ViewVC logotype

Diff of /branches/newio/src/mempool.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2407 by michael, Sat Jul 13 22:13:28 2013 UTC revision 2408 by michael, Thu Jul 18 19:57:58 2013 UTC
# Line 211  struct mp_chunk_t { Line 211  struct mp_chunk_t {
211    char mem[]; /**< Storage for this chunk. */    char mem[]; /**< Storage for this chunk. */
212  };  };
213    
214    
215    static struct Timer garbage_collect_timer;
216  static mp_pool_t *mp_allocated_pools = NULL;  static mp_pool_t *mp_allocated_pools = NULL;
217    
218  /** Number of extra bytes needed beyond mem_size to allocate a chunk. */  /** Number of extra bytes needed beyond mem_size to allocate a chunk. */
# Line 226  static mp_pool_t *mp_allocated_pools = N Line 228  static mp_pool_t *mp_allocated_pools = N
228  void  void
229  mp_pool_init(void)  mp_pool_init(void)
230  {  {
231    eventAdd("mp_pool_garbage_collect", &mp_pool_garbage_collect, NULL, 119);    timer_add(timer_init(&garbage_collect_timer), mp_pool_garbage_collect, 0, TT_PERIODIC, 120);
232  }  }
233    
234  /** Helper: Allocate and return a new memory chunk for <b>pool</b>.  Does not  /** Helper: Allocate and return a new memory chunk for <b>pool</b>.  Does not
# Line 643  mp_pool_assert_ok(mp_pool_t *pool) Line 645  mp_pool_assert_ok(mp_pool_t *pool)
645  }  }
646    
647  void  void
648  mp_pool_garbage_collect(void *arg)  mp_pool_garbage_collect(struct Event *ev)
649  {  {
650    mp_pool_t *pool = mp_allocated_pools;    mp_pool_t *pool = mp_allocated_pools;
651    

Legend:
Removed from v.2407  
changed lines
  Added in v.2408

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.28