[dovecot-cvs] dovecot/src/lib mempool-alloconly.c,1.26,1.27
cras at procontrol.fi
cras at procontrol.fi
Mon Jul 5 18:01:56 EEST 2004
- Previous message: [dovecot-cvs]
dovecot/src/lib-index mail-index-sync-private.h, 1.10,
1.11 mail-index-sync-update.c, 1.35,
1.36 mail-index-view-sync.c, 1.14, 1.15 mail-transaction-log.c,
1.45, 1.46
- Next message: [dovecot-cvs] dovecot/src/pop3-login client-authenticate.c, 1.21,
1.22
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv27489/lib
Modified Files:
mempool-alloconly.c
Log Message:
pool_alloconly_free() can free the last allocation.
Index: mempool-alloconly.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/mempool-alloconly.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- mempool-alloconly.c 21 Sep 2003 17:55:36 -0000 1.26
+++ mempool-alloconly.c 5 Jul 2004 15:01:52 -0000 1.27
@@ -186,10 +186,17 @@
return mem;
}
-static void pool_alloconly_free(pool_t pool __attr_unused__,
- void *mem __attr_unused__)
+static void pool_alloconly_free(pool_t pool, void *mem)
{
- /* ignore */
+ struct alloconly_pool *apool = (struct alloconly_pool *) pool;
+
+ /* we can free only the last allocation */
+ if (POOL_BLOCK_DATA(apool->block) +
+ (apool->block->size - apool->block->left -
+ apool->block->last_alloc_size) == mem) {
+ apool->block->left += apool->block->last_alloc_size;
+ apool->block->last_alloc_size = 0;
+ }
}
static int pool_try_grow(struct alloconly_pool *apool, void *mem, size_t size)
- Previous message: [dovecot-cvs]
dovecot/src/lib-index mail-index-sync-private.h, 1.10,
1.11 mail-index-sync-update.c, 1.35,
1.36 mail-index-view-sync.c, 1.14, 1.15 mail-transaction-log.c,
1.45, 1.46
- Next message: [dovecot-cvs] dovecot/src/pop3-login client-authenticate.c, 1.21,
1.22
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the dovecot-cvs
mailing list