8734467f39c1d36050380f07a408860404d60996 |
|
24-Nov-2017 |
Aki Tuomi <aki.tuomi@dovecot.fi> |
mempool-allocfree: Add linked-list malloc allocation
This is useful when you want to actually free memory from pool too |
77eae37a92168171293471dd5eeaab037de54f4a |
|
19-Sep-2017 |
Josef 'Jeff' Sipek <jeff.sipek@dovecot.fi> |
lib: pool_unref(NULL) shoud be a no-op |
71b92ca8e3ecfba24c2247df997719a4a482850c |
|
08-Jun-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: Add i_realloc_type() for i_realloc() that checks for overflows |
c2664306fcea8bcaafd19a6d1b683ef0ad0ece91 |
|
13-Feb-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: Add pool_alloconly_create_clean()
This partially reverts 2a2beae3a4c1e75b3aeff996781503138e6f24bc |
7e90e9424489b06ebe17a019f56eb3624ca091b2 |
|
16-Dec-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: *_new(): Use the new MALLOC_MULTIPLY() macro to avoid overflows
Cast the sizeof() result to unsigned int, because it's definitely always
enough and in many cases this allows optimizing away the wrap-check. |
ceace05582699dd86d6b41a20b87b1272b33352b |
|
05-Oct-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: Simplify static checker's job for i_free() macro. |
cf4bdceafe382cda0f3b7ff39c5327fa96a00fba |
|
05-Oct-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: [ip]_free(mem) is now also guaranteed to set mem=NULL
It was already doing it, but updated the macros and comments to make it
clear that this won't change in future. Changing this would only make it
more likely that bugs occur and the performance improvements would be
close to nonexistent. |
0dffa25d211be541ee3c953b23566a1a990789df |
|
06-Jun-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
global: unsigned int:1 -> bool:1
perl -i -pe 's/unsigned int ([^,:;]+):1;/bool $1:1;/' **/*.[ch] |
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> |
17654607d6adbe64923f023a7120627544c540c8 |
|
16-Jun-2014 |
Timo Sirainen <tss@iki.fi> |
lib: Use __attribute__((returns_nonnull)) for the common memory/string functions.
Also added a couple of missing ATTR_MALLOCs. |
3b364681ab959d6a676f1a6758dd6a064d1e82bf |
|
16-Jun-2014 |
Timo Sirainen <tss@iki.fi> |
lib: Changed mempool.h to use inline functions instead of macros.
This way we can also mark p_malloc() with ATTR_MALLOC. |
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. |
e459d4db582ecc9ce4c2cca14b3cf686e16d2cd0 |
|
20-Feb-2010 |
Timo Sirainen <tss@iki.fi> |
liblib: Added pool_alloconly_get_total_used/alloc_size() functions.
--HG--
branch : HEAD |
648d24583c1574441c4fa0331a90bd4d6e7996c5 |
|
16-Sep-2007 |
Timo Sirainen <tss@iki.fi> |
pool_unref() now takes ** pointer.
--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 |
c25356d5978632df6203437e1953bcb29e0c736f |
|
16-Sep-2007 |
Timo Sirainen <tss@iki.fi> |
Changed .h ifdef/defines to use <NAME>_H format.
--HG--
branch : HEAD |
91ea6240c34e043ec47068aedc01fdb9b522dc33 |
|
18-Mar-2007 |
Timo Sirainen <tss@iki.fi> |
Added system_clean_pool. default_pool is now set statically, so it can be
changed before calling lib_init(). Use malloc_usable_size() if it's
available for asserts and for implementing system_clean_pool.
--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 |
5c71fd1c3965f2ce66c2b3a7d535e01de1276f9d |
|
08-Nov-2006 |
Timo Sirainen <tss@iki.fi> |
Updated pool_alloconly_create_clean() comment
--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 |
cf37950c9d817a66e0f6a9064b3194c677f23b0b |
|
01-Nov-2006 |
Timo Sirainen <tss@iki.fi> |
Use malloc attribute for the most commonly used memory and string allocation
functions. Use warn_unused_result attribute for reallocs.
--HG--
branch : HEAD |
eebe8b90b8b14d40530e422ab8b42e03b9ebeaf6 |
|
08-Oct-2006 |
Timo Sirainen <tss@iki.fi> |
Added p_free_and_null() and did some cleanups.
--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 |
3bbe99d30871f49610aac0417ee5951d1e740b98 |
|
27-Mar-2005 |
Timo Sirainen <tss@iki.fi> |
Added pool_get_exp_grown_size(). Use it for buffers, istreams and ostreams
when buffer needs to grow. Optimizes memory usage a bit.
--HG--
branch : HEAD |
dd0fd94add215d793a6869215c0509308b94c877 |
|
27-Mar-2005 |
Timo Sirainen <tss@iki.fi> |
Added p_get_max_easy_alloc_size().
--HG--
branch : HEAD |
bf1bf76e55b9f9a0d1952db6eb55bbec3672dd94 |
|
06-Jan-2004 |
Timo Sirainen <tss@iki.fi> |
pool_unref(x): don't set (x) = NULL, it may have been allocated from the
pool that was just freed.
--HG--
branch : HEAD |
c71a9c4d81b80083c13f908162515142b951ecf4 |
|
21-Sep-2003 |
Timo Sirainen <tss@iki.fi> |
Make i_free(), p_free() and pool_unref() calls also set the given parameter
to NULL.
--HG--
branch : HEAD |
f1d7350d5cbf886840668f58e5535a85af90e6cd |
|
21-Sep-2003 |
Timo Sirainen <tss@iki.fi> |
Removed pool leak checking stuff, it's not used.
--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 |
ad0ef8f436c41037e9f1d70286f7054e400fad92 |
|
18-May-2003 |
Timo Sirainen <tss@iki.fi> |
Added pool_get_name(), for debugging mostly.
--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 |
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 |
b53ec8a932a4ea4b983d0e4318ef0ea505c5f9b0 |
|
02-Dec-2002 |
Timo Sirainen <tss@iki.fi> |
We shouldn't cast sizeof() to unsigned int.
--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 |
a51860200ee742ac0e9942d51b0f911776b25138 |
|
09-Oct-2002 |
Timo Sirainen <tss@iki.fi> |
s/t_try_grow/t_try_realloc/
--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 |
66251e6ab31e5cc153fe5cae608e416dacafe9cd |
|
08-Aug-2002 |
Timo Sirainen <tss@iki.fi> |
Initial revision
--HG--
branch : HEAD |