bcb4e51a409d94ae670de96afb8483a4f7855294 |
|
01-Jan-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
Updated copyright notices to include the year 2018. |
acc6105bd5cf36d8d72165d21f6dc55b0f81fe98 |
|
28-Nov-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: mempool-alloconly - Make sure calloc() size isn't above SSIZE_T_MAX
This avoids valgrind warnings when running unit tests:
Argument 'nmemb' of function calloc has a fishy (possibly negative) value: -9223372036854775808 |
e4a7dbe5e02280e561d9ac438326ed70700cd39b |
|
27-Nov-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: mempool-alloconly - Cleanly fail allocations just below SSIZE_T_MAX
Previously it would have assert-crashed in nearest_power(). |
cbe4d8212ec8b9014ae7ae892e90abb98a15d797 |
|
07-Jul-2017 |
Josef 'Jeff' Sipek <jeff.sipek@dovecot.fi> |
lib: remove support for Boehm GC
There were several issues with our usage of Boehm GC:
- it didn't help with memory fragmentation
- it is not very efficient
- it was rarely enabled & used
Proper use of a GC would involve radical changes to how we write code
and cause portability issues. We can get most of the benefits of a GC
with data stacks and alloc-only memory pools. |
c2664306fcea8bcaafd19a6d1b683ef0ad0ece91 |
|
13-Feb-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: Add pool_alloconly_create_clean()
This partially reverts 2a2beae3a4c1e75b3aeff996781503138e6f24bc |
2454dfa32c93c20a8522c6ed42fe057baaac9f9a |
|
01-Jan-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
Updated copyright notices to include the year 2017. |
efe78d3ba24fc866af1c79b9223dc0809ba26cad |
|
24-Dec-2016 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
global: Replaced all instances of memset(p, 0, sizeof(*p)) with the new i_zero() macro.
Used the following script:
C_FILES=`git ls-files *.c`
H_FILES=`git ls-files *.h`
for F in "$C_FILES $H_FILES"; do
echo "$F"
perl -p -i -e 's/safe_memset\(&\(?([^,]*)\)?,\s*0,\s*sizeof\(\g1\)\)/i_zero_safe(&$1)/g' $F
perl -p -i -e 's/safe_memset\(([^,]*),\s*0,\s*sizeof\(\*\g1\)\)/i_zero_safe($1)/g' $F
perl -p -i -e 's/memset\(&\(?([^,]*)\)?,\s*0,\s*sizeof\(\g1\)\)/i_zero(&$1)/g' $F
perl -p -i -e 's/memset\(([^,]*),\s*0,\s*sizeof\(\*\g1\)\)/i_zero($1)/g' $F
done |
9745f03bbaaa3d15043d231b84128beecf97dd93 |
|
01-Aug-2016 |
Martti Rannanjärvi <martti.rannanjarvi@dovecot.fi> |
lib,lib-test: i_warning to i_debug on alloc growing messages |
84c1b1af9d4739334ec423a264dea1c265d7ad30 |
|
22-Apr-2016 |
Baofeng Wang <baofeng.wang@dovecot.fi> |
liblib: pool_unref() should always set pool=NULL (alloconly pool)
set pool to NULL before return. |
02c335c23bf5fa225a467c19f2c063fb0dc7b8c3 |
|
12-Jan-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
global: freshen copyright
git ls-files | xargs perl -p -i -e 's/(\d+)-201[0-5]/$1-2016/g;s/ (201[0-5]) Dovecot/ $1-2016 Dovecot/' |
814bf67459ad405a157af0b8940602024d7fadfe |
|
23-Sep-2015 |
Teemu Huovila <teemu.huovila@dovecot.fi> |
Remove now-unnecessary direct stdlib.h #includes. |
7cb128dc4cae2a03a742f63ba7afee23c78e3af0 |
|
05-Jan-2015 |
Phil Carmody <phil@dovecot.fi> |
global: freshen copyright
Robomatically:
git ls-files | xargs perl -p -i -e 's/(\d+)-201[0-4]/$1-2015/g;s/ (201[0-4]) Dovecot/ $1-2015 Dovecot/'
Happy 2015 everyone!
Signed-off-by: Phil Carmody <phil@dovecot.fi> |
5517afec377fb7bf80e589b3efdd975f61dad5b3 |
|
28-Jul-2014 |
Phil Carmody <phil@dovecot.fi> |
lib: cosmetic - whitespace cleanup in allocator/memory-related code
Indentation used spaces. Some trailing whitespace found.
$ git diff -w
$
Signed-off-by: Phil Carmody <phil@dovecot.fi> |
a8c5a86d183db25a57bf193c06b41e092ec2e151 |
|
04-Feb-2014 |
Timo Sirainen <tss@iki.fi> |
Updated copyright notices to include year 2014. |
5a580c3a38ced62d4bcc95b8ac7c4f2935b5d294 |
|
02-Feb-2013 |
Timo Sirainen <tss@iki.fi> |
Oops :) Update copyrights to 2013 without breaking all .c files. |
cca4ba2a504d70a9fe9fee37f8433997359de52c |
|
02-Feb-2013 |
Timo Sirainen <tss@iki.fi> |
Updated copyright notices to include year 2013. |
ce82f77b9f99138e6a72829718f9fe4d9cc6d241 |
|
10-Apr-2012 |
Timo Sirainen <tss@iki.fi> |
--enable-devel-checks: If DEBUG_SILENT environment is set, hide "Growing pool" warnings. |
5f5870385cff47efd2f58e7892f251cf13761528 |
|
12-Feb-2012 |
Timo Sirainen <tss@iki.fi> |
Updated copyright notices to include year 2012. |
2e37d45867d081db150ab78dad303b9077aea24f |
|
04-Mar-2011 |
Timo Sirainen <tss@iki.fi> |
Updated copyright notices to include year 2011. |
183bea41fa640dc8117f3eb45ff935cd81377a84 |
|
04-Mar-2011 |
Timo Sirainen <tss@iki.fi> |
Updated copyright notices to include year 2011. |
49469ba8d56af14eac821639774e6c091985be3e |
|
03-Sep-2010 |
Timo Sirainen <tss@iki.fi> |
alloconly mempool: Clear pool with memset(), not safe_memset(). |
2a2beae3a4c1e75b3aeff996781503138e6f24bc |
|
03-Sep-2010 |
Timo Sirainen <tss@iki.fi> |
liblib: Removed unused system-clean and alloconly-clean mempools.
They're just making the code messier and slower. |
18722dd1c05fdf3f47ec9dcd910bebbdb87684ac |
|
08-Mar-2010 |
Timo Sirainen <tss@iki.fi> |
Reversing accidentally committed debug code.
--HG--
branch : HEAD |
d7b81a1e17f5b115cb1b36bf6c6f64295e357dc2 |
|
08-Mar-2010 |
Timo Sirainen <tss@iki.fi> |
Improved setgid/setuid failure's error message.
--HG--
branch : HEAD |
e459d4db582ecc9ce4c2cca14b3cf686e16d2cd0 |
|
20-Feb-2010 |
Timo Sirainen <tss@iki.fi> |
liblib: Added pool_alloconly_get_total_used/alloc_size() functions.
--HG--
branch : HEAD |
e59faf65ce864fe95dc00f5d52b8323cdbd0608a |
|
25-Jan-2010 |
Timo Sirainen <tss@iki.fi> |
Updated copyright notices to include year 2010.
--HG--
branch : HEAD |
7bafda1813454621e03615e83d55bccfa7cc56bd |
|
04-Dec-2009 |
Timo Sirainen <tss@iki.fi> |
Removed MEMBER() macro. Require C99 style struct initializer.
--HG--
branch : HEAD |
45312f52ff3a3d4c137447be4c7556500c2f8bf2 |
|
06-Jan-2009 |
Timo Sirainen <tss@iki.fi> |
Updated copyright notices to include year 2009.
--HG--
branch : HEAD |
2b9884cebb11fdcdfd2959afcd35063d608c287b |
|
22-Sep-2008 |
Timo Sirainen <tss@iki.fi> |
If memory allocation fails, log how large allocation we were trying to do.
--HG--
branch : HEAD |
a7c3d621ff80e8980d5bf4d4c6c3dc01495e9db7 |
|
04-May-2008 |
Timo Sirainen <tss@iki.fi> |
DEBUG: Fixes to calculating minimum initial pool size in debug mode.
--HG--
branch : HEAD |
8e31e038ae271c7bb9c2fa24f039f3416dbfb291 |
|
04-May-2008 |
Timo Sirainen <tss@iki.fi> |
Use smaller sentries between allocations. Larger ones make "Growing memory
pool" warnings pointless, because most of the space is wasted on sentries. A
smaller sentry will still catch most of the buffer overflows.
--HG--
branch : HEAD |
7f0798fb119cd2f5eac5e9fbbfb81777afee87e3 |
|
30-Apr-2008 |
Timo Sirainen <tss@iki.fi> |
DEBUG: Make sure mempool's initial size is large enough to account for
extra sentries.
--HG--
branch : HEAD |
f3960676f495ec0359fd6df9d6f23df98931cf2b |
|
01-Apr-2008 |
Timo Sirainen <tss@iki.fi> |
DEBUG: Added buffer overflow checking to alloconly memory pools.
--HG--
branch : HEAD |
be59ecff43d84e96b919b946251190ba495e7309 |
|
03-Mar-2008 |
Timo Sirainen <tss@iki.fi> |
DEBUG: Use t_buffer_alloc_last_full() before calling i_warning() to make
sure we don't trash unallocated data from data stack.
--HG--
branch : HEAD |
103b2f1004118fbf7ff352e96e8f1ec0ed20e806 |
|
03-Mar-2008 |
Timo Sirainen <tss@iki.fi> |
DEBUG: Use t_buffer_alloc_last_full() before calling i_warning() to make
sure we don't trash unallocated data from data stack.
--HG--
branch : HEAD |
01a170c984df9e5fc0f28aa7695e0cbbdb3c9029 |
|
03-Jan-2008 |
Timo Sirainen <tss@iki.fi> |
If giving pool_alloconly_create() less than 40 bytes as the initial size
with 32bit systems, destroying the pool crashed.
--HG--
branch : HEAD |
76b43e4417bab52e913da39b5f5bc2a130d3f149 |
|
01-Jan-2008 |
Timo Sirainen <tss@iki.fi> |
Updated copyright notices to include year 2008.
--HG--
branch : HEAD |
c9bf63e9094761767a63ac6b189bcf60bcffdc44 |
|
17-Nov-2007 |
Timo Sirainen <tss@iki.fi> |
Use likely() and unlikely() macros to make commonly checked error handling
paths unlikely.
--HG--
branch : HEAD |
89a126810703c666309310d0f3189e9834d70b5b |
|
16-Sep-2007 |
Timo Sirainen <tss@iki.fi> |
Replaced my Copyright notices. The year range always ends with 2007 now.
My name was replaced with "Dovecot authors". In many cases I didn't really
even own the copyright, so this is more correct.
--HG--
branch : HEAD |
43d32cbe60fdaef2699d99f1ca259053e9350411 |
|
16-Sep-2007 |
Timo Sirainen <tss@iki.fi> |
Renamed __attr_*__ to ATTR_*. Renamed __attrs_used__ to ATTRS_DEFINED.
--HG--
branch : HEAD |
0db973ccb4c12f5c9ea3bed933a9df2d4b62ab7b |
|
25-Feb-2007 |
Timo Sirainen <tss@iki.fi> |
alloconly pool: pool_unref() shouldn't set the pool pointer to NULL unless
refcount=0.
--HG--
branch : HEAD |
9fc1a772651e6f146ed6da5ee33fcb6452dd45db |
|
18-Jan-2007 |
Timo Sirainen <tss@iki.fi> |
Don't keep the memory pool virtual functions in the pool structure itself,
rather access them via a pointer to a shared virtual function struct.
Reduces memory usage a bit.
--HG--
branch : HEAD |
588f592a98fca95a10aaccdc76a589558e9ba125 |
|
29-Dec-2006 |
Timo Sirainen <tss@iki.fi> |
debug: MEMPOOL_GROWING prefix in alloconly pool names means that when
the memory pool needs to be grown, there's no need to log a warning.
--HG--
branch : HEAD |
25e5b3b260e90c7172e68bef1fdfafd4783eddc7 |
|
08-Nov-2006 |
Timo Sirainen <tss@iki.fi> |
Added pool_alloconly_create_clean() to create an alloconly pool which clears
the memory it uses before freeing it.
--HG--
branch : HEAD |
333e77916f5c17eac34c77b54281a5e9435032c3 |
|
10-Sep-2006 |
Timo Sirainen <tss@iki.fi> |
Fixes for using GC
--HG--
branch : HEAD |
22188a7bad620edf9536e02eb9e5cfc5d0e59d97 |
|
08-Jun-2006 |
Timo Sirainen <tss@iki.fi> |
base_size variable isn't really needed in the pool when DEBUG isn't used.
With DEBUG enabled, check when clearing the pool that the allocated memory
is completely cleared, ie. that no-one wrote out of bounds to it.
--HG--
branch : HEAD |
79cb06c24ae30516d819cafb34344d8ba84262ec |
|
14-Jan-2006 |
Timo Sirainen <tss@iki.fi> |
pool_unref(): set the pool pointer to NULL, so if we're trying to unref it
twice we'll do a clean crash.
--HG--
branch : HEAD |
6ef7e31619edfaa17ed044b45861d106a86191ef |
|
13-Jan-2006 |
Timo Sirainen <tss@iki.fi> |
Added "bool" type and changed all ints that were used as booleans to bool.
--HG--
branch : HEAD |
7e80c968cd8cb63e874b9a5ad9e39bd510005a57 |
|
03-May-2005 |
Timo Sirainen <tss@iki.fi> |
Compiler warning fix without DEBUG.
--HG--
branch : HEAD |
65343441df458299bce0bfb8b59a0e0b060564b0 |
|
23-Apr-2005 |
Timo Sirainen <tss@iki.fi> |
Remove compiler warnings with non-DEBUG.
--HG--
branch : HEAD |
0881f33a9a8a8e2f0623fad250d9813906fd24ce |
|
27-Mar-2005 |
Timo Sirainen <tss@iki.fi> |
Changed alloconly pools to call malloc() only once when creating the pool.
Pool names aren't used anymore without DEBUG. Don't immediately double the
pool's initial size for the first allocated block.
--HG--
branch : HEAD |
dd0fd94add215d793a6869215c0509308b94c877 |
|
27-Mar-2005 |
Timo Sirainen <tss@iki.fi> |
Added p_get_max_easy_alloc_size().
--HG--
branch : HEAD |
8afe3f0e832b8b3483b692205bbd59c0110a20fd |
|
13-Mar-2005 |
Timo Sirainen <tss@iki.fi> |
If we run out of memory, exit with FATAL_OUTOFMEM status instead of dumping
core. Also changed a few other i_panic() calls to others.
--HG--
branch : HEAD |
1bb6586a424225406d55f9fc52a1f11579563073 |
|
08-Jul-2004 |
Timo Sirainen <tss@iki.fi> |
If p_free() frees memory, it must also zero it..
--HG--
branch : HEAD |
d3366e96ea7dbee2af95357c36b7844ebb62d934 |
|
05-Jul-2004 |
Timo Sirainen <tss@iki.fi> |
pool_alloconly_free() can free the last allocation.
--HG--
branch : HEAD |
81a07ac5ff4bb89761c2cf8d3e56ae902e4648e1 |
|
21-Sep-2003 |
Timo Sirainen <tss@iki.fi> |
Added support for Boehm GC. However it seems to be crashing for some reason
with me..
--HG--
branch : HEAD |
cd466fe7b84b0223735a6469c7f7bc225f65996d |
|
21-Sep-2003 |
Timo Sirainen <tss@iki.fi> |
data_stack_pool split into two: unsafe_data_stack_pool which works like
before, and a new one which verifies that stack frame stays the same
whenever the pool is accessed.
--HG--
branch : HEAD |
5e0ce63bb65db34d7f48b34bbb5545fa791781c4 |
|
26-Aug-2003 |
Timo Sirainen <tss@iki.fi> |
Removed most of the license comments from src/lib/*.c. It's just fine to
keep them in a single COPYING.MIT file. Changed a few other comments as well.
--HG--
branch : HEAD |
dd13c7e760ee673028b634d2fb0a46e3bea533ed |
|
06-Aug-2003 |
Timo Sirainen <tss@iki.fi> |
reallocing clears memory unneededly since it's always already cleared
--HG--
branch : HEAD |
ad0ef8f436c41037e9f1d70286f7054e400fad92 |
|
18-May-2003 |
Timo Sirainen <tss@iki.fi> |
Added pool_get_name(), for debugging mostly.
--HG--
branch : HEAD |
0abc51fab0fe288f4aa4d40cd61ea5c01a0e1dcd |
|
11-Apr-2003 |
Timo Sirainen <tss@iki.fi> |
p_clear() left only the smallest block, not the largest block
--HG--
branch : HEAD |
e249c8dafd768240b00be718f46d23874499a0bf |
|
08-Feb-2003 |
Timo Sirainen <tss@iki.fi> |
DEBUG: we cleared wrong memory block..
--HG--
branch : HEAD |
caeaca5c71402e95534bdf3ffb877c04f18c95b9 |
|
08-Feb-2003 |
Timo Sirainen <tss@iki.fi> |
DEBUG: fill memory with 0xde before freeing it
--HG--
branch : HEAD |
f94332a6f35455f112cb7dfccfff369fbc55d8cc |
|
11-Jan-2003 |
Timo Sirainen <tss@iki.fi> |
Added alloconly_pool field for checking if pool supports free()
--HG--
branch : HEAD |
01af88dfbb7a022ddb3ab9fb4159f2a4a204ead3 |
|
10-Jan-2003 |
Timo Sirainen <tss@iki.fi> |
Added old_size parameter to p_realloc() - we rarely need it and this way
each allocation takes 8 bytes less memory.
--HG--
branch : HEAD |
c0435c854a0e7246373b9752d163095cc4fbe985 |
|
05-Jan-2003 |
Timo Sirainen <tss@iki.fi> |
Naming style changes, finally got tired of most of the typedefs. Also the
previous enum -> macro change reverted so that we don't use the highest bit
anymore, that's incompatible with old indexes so they will be rebuilt.
--HG--
branch : HEAD |
80d3b05559a9024b8352d52419a1b1c0aeca654e |
|
27-Dec-2002 |
Timo Sirainen <tss@iki.fi> |
Removed pool->realloc_min() which nothing used. A few small fixes to
alloc-only pool.
--HG--
branch : HEAD |
e1e5b1f4ada9d9b4d36edeaf1c5229be90b12815 |
|
22-Dec-2002 |
Timo Sirainen <tss@iki.fi> |
String function cleanups. Allocating 0 bytes of memory is treated as error
now, it could be an integer overflow. Moved printf_string_upper_bound() to
it's own file, so strfuncs.c can be with MIT license.
--HG--
branch : HEAD |
aec53c0bccddc338722bd466dcd93b329c4e5295 |
|
21-Dec-2002 |
Timo Sirainen <tss@iki.fi> |
DEBUG: warn when growing pool
--HG--
branch : HEAD |
2b619d427addefb7d1660b23a528259d162a5f67 |
|
21-Dec-2002 |
Timo Sirainen <tss@iki.fi> |
We don't have separate read-write pools, so renamed pool_create(.., FALSE)
to pool_alloconly_create().
--HG--
branch : HEAD |
555ebb032f9b8f0cdb66f27ce7374734833e7cac |
|
19-Dec-2002 |
Timo Sirainen <tss@iki.fi> |
Buffer related cleanups. Use PATH_MAX instead of hardcoded 1024 for paths.
Added str_path() and str_ppath() functions. i_snprintf() now returns only -1
or 0 depending on if buffer got full. dec2str() returns the string allocated
from data stack. Instead of just casting to (long) or (int), we now use
dec2str() with printf-like functions. Added o_stream_send_str(). Added
strocpy() and replaced all strcpy()s and strncpy()s with it.
Pretty much untested, hope it doesn't break too badly :)
--HG--
branch : HEAD |
5254d77805cd35b9356d072ba325c356c43b0d51 |
|
18-Dec-2002 |
Timo Sirainen <tss@iki.fi> |
Marked all non-trivial buffer modifications with @UNSAFE tag. Several
cleanups and a couple of minor bugfixes.
--HG--
branch : HEAD |
caffa4b1d81af4d48c1eedba2103f291beb0f62d |
|
26-Nov-2002 |
Timo Sirainen <tss@iki.fi> |
Use more warnings with GCC by default. Fixed several warnings.
--HG--
branch : HEAD |
e4af52c1ff7edb2bdecc3b99520cbf062db3e6af |
|
26-Nov-2002 |
Timo Sirainen <tss@iki.fi> |
Don't do void* arithmetics.
--HG--
branch : HEAD |
4fc1b4ef253b1609b41b0029f2e54439138865c7 |
|
14-Oct-2002 |
Timo Sirainen <tss@iki.fi> |
p_realloc() was buggy
--HG--
branch : HEAD |
269ad7ba3c50fc135abfede14b603f753df8f3f2 |
|
13-Oct-2002 |
Timo Sirainen <tss@iki.fi> |
Check return values for malloc()s and calloc()s.
--HG--
branch : HEAD |
3bc5ee88988bb8ffc53cab34c6abf895c8c61d35 |
|
29-Sep-2002 |
Timo Sirainen <tss@iki.fi> |
more ANSI-C fixes.
--HG--
branch : HEAD |
d2f5aacd3d549c3d39dae41b6522d585244b016d |
|
08-Sep-2002 |
Timo Sirainen <tss@iki.fi> |
size_t fixes for lib/. Changed OFF_T_FORMAT to PRIuOFF_T which is more
C99-like.
--HG--
branch : HEAD |
b482cdc6828fa97ff97d13ee88aba37c92f8a180 |
|
28-Aug-2002 |
Timo Sirainen <tss@iki.fi> |
Still memaligns
--HG--
branch : HEAD |
99bfab1b2c5bfbf7e50b2946d11c130b5a893a4a |
|
28-Aug-2002 |
Timo Sirainen <tss@iki.fi> |
Allocated memory wasn't aligned according to MEM_ALIGN_SIZE.
--HG--
branch : HEAD |
66251e6ab31e5cc153fe5cae608e416dacafe9cd |
|
08-Aug-2002 |
Timo Sirainen <tss@iki.fi> |
Initial revision
--HG--
branch : HEAD |