[dovecot-cvs] dovecot/src/lib-imap imap-parser.c,1.31,1.32
cras at procontrol.fi
cras at procontrol.fi
Fri Jan 10 22:58:30 EET 2003
- Previous message: [dovecot-cvs] dovecot/src/lib-index mail-index-data.c,1.33,1.34
- Next message: [dovecot-cvs] dovecot/src/lib buffer.c,1.7,1.8 hash.c,1.7,1.8 hash.h,1.4,1.5 imem.c,1.7,1.8 imem.h,1.7,1.8 ioloop-poll.c,1.7,1.8 istream-file.c,1.5,1.6 mempool-alloconly.c,1.16,1.17 mempool-datastack.c,1.5,1.6 mempool-system.c,1.8,1.9 mempool.h,1.8,1.9 Message-Id: <20030110205830.B5B422387C@danu.procontrol.fi>
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/dovecot/src/lib-imap
In directory danu:/tmp/cvs-serv2584/lib-imap
Modified Files:
imap-parser.c
Log Message:
Added old_size parameter to p_realloc() - we rarely need it and this way
each allocation takes 8 bytes less memory.
Index: imap-parser.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-imap/imap-parser.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- imap-parser.c 5 Jan 2003 13:09:52 -0000 1.31
+++ imap-parser.c 10 Jan 2003 20:58:28 -0000 1.32
@@ -46,14 +46,16 @@
unsigned int eol:1;
};
-#define LIST_REALLOC(parser, old_list, size) \
+/* @UNSAFE */
+#define LIST_REALLOC(parser, old_list, new_size) \
p_realloc((parser)->pool, old_list, \
sizeof(struct imap_arg_list) + \
- sizeof(struct imap_arg) * ((size)-1))
+ (old_list == NULL ? 0 : \
+ sizeof(struct imap_arg) * (old_list)->alloc), \
+ sizeof(struct imap_arg) * (new_size))
static void imap_args_realloc(struct imap_parser *parser, size_t size)
{
- /* @UNSAFE */
parser->cur_list = LIST_REALLOC(parser, parser->cur_list, size);
parser->cur_list->alloc = size;
@@ -536,10 +538,10 @@
that last argument isn't only partially parsed. */
if (count >= parser->root_list->alloc) {
/* unused arguments must be NIL-filled. */
- parser->root_list->alloc = count+1;
parser->root_list = LIST_REALLOC(parser,
parser->root_list,
count+1);
+ parser->root_list->alloc = count+1;
}
parser->root_list->args[parser->root_list->size].type =
- Previous message: [dovecot-cvs] dovecot/src/lib-index mail-index-data.c,1.33,1.34
- Next message: [dovecot-cvs] dovecot/src/lib buffer.c,1.7,1.8 hash.c,1.7,1.8 hash.h,1.4,1.5 imem.c,1.7,1.8 imem.h,1.7,1.8 ioloop-poll.c,1.7,1.8 istream-file.c,1.5,1.6 mempool-alloconly.c,1.16,1.17 mempool-datastack.c,1.5,1.6 mempool-system.c,1.8,1.9 mempool.h,1.8,1.9 Message-Id: <20030110205830.B5B422387C@danu.procontrol.fi>
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the dovecot-cvs
mailing list