Mercurial > dovecot > original-hg > dovecot-1.2
changeset 400:f3ab97771ed8 HEAD
changed all "temporary memory pool" references to "data stack"
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Wed, 09 Oct 2002 20:49:41 +0300 |
parents | 383503837741 |
children | ec0b16ee7ef9 |
files | src/auth/auth.c src/lib-mail/message-content-parser.h src/lib-mail/message-parser.h src/lib-mail/message-part-serialize.h src/lib-mail/rfc822-tokenize.h src/lib-storage/index/index-fetch-section.c src/lib-storage/mail-storage.h src/lib/base64.h src/lib/hex-binary.h src/lib/temp-string.h |
diffstat | 10 files changed, 15 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/src/auth/auth.c Wed Oct 09 20:44:04 2002 +0300 +++ b/src/auth/auth.c Wed Oct 09 20:49:41 2002 +0300 @@ -127,7 +127,7 @@ methods++; } - /* get our realm - note that we allocate from temp. memory pool so + /* get our realm - note that we allocate from data stack so this function should never be called inside I/O loop or anywhere else where t_pop() is called */ env = getenv("REALMS");
--- a/src/lib-mail/message-content-parser.h Wed Oct 09 20:44:04 2002 +0300 +++ b/src/lib-mail/message-content-parser.h Wed Oct 09 20:49:41 2002 +0300 @@ -1,7 +1,7 @@ #ifndef __MESSAGE_CONTENT_PARSER_H #define __MESSAGE_CONTENT_PARSER_H -/* functions can safely store data into temporary memory pool, +/* functions can safely store data into data stack, ie. message_content_parse_header() is guaranteed not to call t_push()/t_pop() */
--- a/src/lib-mail/message-parser.h Wed Oct 09 20:44:04 2002 +0300 +++ b/src/lib-mail/message-parser.h Wed Oct 09 20:49:41 2002 +0300 @@ -49,9 +49,9 @@ /* Call func for each field in message header. Fills the hdr_size. part can be NULL, just make sure your header function works with it. - This function doesn't use temp. mempool so your header function may save - return values to it. When finished, inbuf will point to beginning of - message body. */ + This function doesn't use data stack so your header function may save + values to it. When finished, inbuf will point to beginning of message + body. */ void message_parse_header(MessagePart *part, IOBuffer *inbuf, MessageSize *hdr_size, MessageHeaderFunc func, void *context);
--- a/src/lib-mail/message-part-serialize.h Wed Oct 09 20:44:04 2002 +0300 +++ b/src/lib-mail/message-part-serialize.h Wed Oct 09 20:49:41 2002 +0300 @@ -1,7 +1,7 @@ #ifndef __MESSAGE_PART_SERIALIZE_H #define __MESSAGE_PART_SERIALIZE_H -/* Serialize message part, allocating memory from temporary pool. +/* Serialize message part, allocating memory from data stack. size is updated to contain the size of returned data. */ const void *message_part_serialize(MessagePart *part, size_t *size);
--- a/src/lib-mail/rfc822-tokenize.h Wed Oct 09 20:44:04 2002 +0300 +++ b/src/lib-mail/rfc822-tokenize.h Wed Oct 09 20:49:41 2002 +0300 @@ -42,7 +42,7 @@ char missing_char, void *context); /* Tokenize the string. Returns NULL if string is empty. Memory for - returned array is allocated from temporary pool. You don't have to use + returned array is allocated from data stack. You don't have to use the tokens_count, since last token is always 0. */ const Rfc822Token *rfc822_tokenize(const char *str, int *tokens_count, Rfc822TokenizeErrorFunc error_func,
--- a/src/lib-storage/index/index-fetch-section.c Wed Oct 09 20:44:04 2002 +0300 +++ b/src/lib-storage/index/index-fetch-section.c Wed Oct 09 20:49:41 2002 +0300 @@ -261,10 +261,9 @@ sect->skip, sect->max_size); } - /* partial headers - copy the wanted fields into temporary memory. - Insert missing CRs on the way. If the header is too large, - calculate the size first and then send the data directly to - output buffer. */ + /* partial headers - copy the wanted fields into memory, inserting + missing CRs on the way. If the header is too large, calculate + the size first and then send the data directly to output buffer. */ memset(&ctx, 0, sizeof(ctx)); ctx.skip = sect->skip;
--- a/src/lib-storage/mail-storage.h Wed Oct 09 20:44:04 2002 +0300 +++ b/src/lib-storage/mail-storage.h Wed Oct 09 20:49:41 2002 +0300 @@ -194,7 +194,7 @@ unsigned int diskspace_full:1; - /* may be allocated from temp pool */ + /* may be allocated from data stack */ const char *custom_flags[MAIL_CUSTOM_FLAGS_COUNT]; };
--- a/src/lib/base64.h Wed Oct 09 20:44:04 2002 +0300 +++ b/src/lib/base64.h Wed Oct 09 20:49:41 2002 +0300 @@ -1,7 +1,7 @@ #ifndef __BASE64_H #define __BASE64_H -/* Translates binary data into base64. Allocates memory from temporary pool. */ +/* Translates binary data into base64. Allocates memory from data stack. */ const char *base64_encode(const unsigned char *data, size_t size); /* Translates base64 data into binary modifying the data itself.
--- a/src/lib/hex-binary.h Wed Oct 09 20:44:04 2002 +0300 +++ b/src/lib/hex-binary.h Wed Oct 09 20:49:41 2002 +0300 @@ -2,7 +2,7 @@ #define __HEX_BINARY_H /* Convert binary to lowercased hex digits allocating return value from - temporary memory pool */ + data stack */ const char *binary_to_hex(const unsigned char *data, size_t size); /* Convert hex to binary. data and dest may point to same value.
--- a/src/lib/temp-string.h Wed Oct 09 20:44:04 2002 +0300 +++ b/src/lib/temp-string.h Wed Oct 09 20:49:41 2002 +0300 @@ -1,8 +1,8 @@ #ifndef __TEMP_STRING_H #define __TEMP_STRING_H -/* All memory in TempString is allocated from temporary memory pool, - so it can't be stored permanently. */ +/* All memory in TempString is allocated from data stack, so it MUST NOT be + stored permanently. */ struct _TempString { char *str; @@ -16,11 +16,6 @@ void t_string_append_n(TempString *tstr, const char *str, size_t size); void t_string_append_c(TempString *tstr, char chr); -/* Insert string/character (FIXME: not implemented) */ -/*void t_string_insert(TempString *tstr, int pos, const char *str); -void t_string_insert_n(TempString *tstr, int pos, const char *str, int size); -void t_string_insert_c(TempString *tstr, int pos, char chr);*/ - /* Append printf()-like data */ void t_string_printfa(TempString *tstr, const char *fmt, ...) __attr_format__(2, 3);