| Age | Commit message (Collapse) | Author | Lines | |
|---|---|---|---|---|
| 2021-10-07 | lib: t_get_bytes_available() - Move code inside DEBUG to avoid dead code warning | Timo Sirainen | -1/+1 | |
| 2021-10-06 | lib: Fix data_stack_get_alloc_size() and data_stack_get_used_size() | Timo Sirainen | -2/+2 | |
| It only worked correctly if data stack hadn't been grown. This resulted in wrong numbers in the data_stack_grow event. | ||||
| 2021-09-22 | lib: Add most data_stack_grow event fields before checking if event is wanted | Timo Sirainen | -6/+14 | |
| This allows using e.g. "event=data_stack_grow and alloc_size > 32768" as an event filter. | ||||
| 2021-08-09 | lib: data-stack - Initialize alloc_count / alloc_bytes | Aki Tuomi | -0/+4 | |
| This has only effect with devel checks enabled. Fixes counter values to show sensible data. | ||||
| 2021-08-09 | lib: data-stack - Allow errno changes when sending event | Aki Tuomi | -0/+8 | |
| 2021-07-19 | lib: data-stack - t_try_realloc() - Add missing ↵ | Timo Sirainen | -0/+1 | |
| data_stack_last_buffer_reset() call This fixes incorrect "buffer overflow" panics with DEBUG builds. | ||||
| 2021-07-19 | lib: data-stack - data_stack_last_buffer_reset(() - Add comments and an assert | Timo Sirainen | -0/+9 | |
| This clarifies how the function is expected to work. | ||||
| 2021-06-01 | lib: DEBUG: Fix potential crash in handling "Growing data stack" debug message | Timo Sirainen | -2/+2 | |
| This could have only happened when data_stack_grow event was enabled and when --enable-devel-checks was used. | ||||
| 2021-05-24 | lib: data-stack - Keep the largest unused block in memory after all | Timo Sirainen | -10/+42 | |
| This reverts 2da21080dbbe50b4924ac0135c84babfb404dcce, but that alone doesn't produce working code so there are also some further fixups. | ||||
| 2021-05-04 | lib: data-stack - If frame doesn't change current block, no blocks need to ↵ | Timo Sirainen | -8/+10 | |
| be freed This is a micro-optimization to t_pop() to avoid an extra if-check. | ||||
| 2021-05-04 | lib: data-stack - Use stack_block.left_lowwater only with DEBUG | Timo Sirainen | -4/+8 | |
| 2021-05-04 | lib: Remove data_stack_set_clean_after_pop() | Timo Sirainen | -23/+13 | |
| 2021-05-04 | lib: data-stack - Move frame memory allocation inside data stack block | Timo Sirainen | -15/+16 | |
| 2021-05-04 | lib: data-stack - Replace stack_frame_block with a single stack_frame | Timo Sirainen | -86/+56 | |
| This simplifies the code at the cost of more memory allocations. However, this will be fixed by the following commit. | ||||
| 2021-05-04 | lib: data-stack - Add data_stack_grow event | Timo Sirainen | -12/+60 | |
| This is now always enabled, not just in debug builds. | ||||
| 2021-05-04 | lib: t_get_bytes_available() - Fix return value when current_block is almost ↵ | Timo Sirainen | -6/+8 | |
| full | ||||
| 2021-05-04 | lib: data-stack - Add t_pop_pass_str() and T_END_PASS_STR[_IF]() | Timo Sirainen | -0/+15 | |
| This simplifies passing error strings out of stack frames. For example: const char *error; T_BEGIN { ... if (ret < 0) error = t_strdup_printf("foo() failed: %m"); } T_END_PASS_STR_IF(ret < 0, &error); // error is still valid | ||||
| 2021-05-04 | lib: Add data_stack_frame_contains() | Timo Sirainen | -0/+43 | |
| 2021-05-04 | lib: Add data_stack_get_alloc_size() | Timo Sirainen | -0/+12 | |
| 2021-05-04 | lib: Fix data_stack_get_used_size() to return correct size | Timo Sirainen | -3/+12 | |
| It only included the last allocated block's used size. | ||||
| 2021-05-04 | lib: data-stack - Don't set stack_block.next=NULL after mem_block_alloc() ↵ | Timo Sirainen | -2/+0 | |
| already did it | ||||
| 2021-05-04 | lib: data-stack - mem_block_alloc() - Set stack_block.left to final value ↵ | Timo Sirainen | -3/+1 | |
| immediately There's no need to first set it to 0 and then have the caller change it again. | ||||
| 2021-05-04 | lib: data-stack - Remove unused_frame_blocks | Timo Sirainen | -24/+6 | |
| It's not that expensive to keep allocating them as needed, and it's a potential waste of memory to keep them around. | ||||
| 2021-05-04 | lib: data-stack - Don't keep largest unused block in memory | Timo Sirainen | -20/+6 | |
| It's not that expensive to allocate it again, but it might be expensive to keep allocated a block that became huge due to a bug. The huge block could be just wasting memory without ever being used again. | ||||
| 2021-05-04 | lib: data-stack - Rename variables in clean_after_pop handling | Timo Sirainen | -6/+6 | |
| These new variables make more sense than the old ones. | ||||
| 2021-05-04 | lib: data-stack - Rename lowwater to left_lowwater | Timo Sirainen | -8/+12 | |
| This describes its behavior better. Also add a comment explaining what exactly it is. | ||||
| 2021-05-04 | lib: data-stack - Rename block_space_used[] to block_space_left[] | Timo Sirainen | -5/+8 | |
| This describes its behavior better. Also add a comment explaining what exactly it is. | ||||
| 2021-05-04 | lib: data-stack - Use INITIAL_STACK_SIZE without growing it to nearest power | Timo Sirainen | -1/+3 | |
| 2021-05-04 | global: Never use t_push(NULL) | Timo Sirainen | -1/+3 | |
| A non-NULL name is expected by the debug logging. | ||||
| 2020-11-23 | lib: Add data_stack_get_used_size() | Timo Sirainen | -0/+10 | |
| Mainly for debugging purposes. | ||||
| 2020-10-22 | global: Disable undefined behaviour sanitization for select locations | Aki Tuomi | -1/+2 | |
| 2020-03-19 | global: use %zu directly instead of PRIuSIZE_T | Josef 'Jeff' Sipek | -4/+4 | |
| 2019-05-13 | lib: data-stack - Make STACK_BLOCK_DATA() behavior clearer | Timo Sirainen | -2/+2 | |
| Otherwise scan-build thinks that it's pointing outside valid memory in the struct and gives an error: "Memory set function accesses out-of-bound array element" | ||||
| 2018-01-01 | Updated copyright notices to include the year 2018. | Stephan Bosch | -1/+1 | |
| 2017-12-25 | lib/data-stack - in panic scenarios, use the panic memory buffer | Phil Carmody | -4/+4 | |
| Signed-off-by: Phil Carmody <phil@dovecot.fi> | ||||
| 2017-12-25 | lib/datastack - remove useless thing | Phil Carmody | -1/+0 | |
| It was useless. Signed-off-by: Phil Carmody <phil@dovecot.fi> | ||||
| 2017-11-27 | lib: Fix logging panic message if data stack canary corruption is detected | Timo Sirainen | -8/+23 | |
| The previous code just recursed into the same canary corruption check and didn't end up logging anything. | ||||
| 2017-10-06 | global: Use PRI* macros and %zu instead of casting | Martti Rannanjärvi | -1/+1 | |
| 2017-07-07 | lib: remove support for Boehm GC | Josef 'Jeff' Sipek | -20/+0 | |
| 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. | ||||
| 2017-01-01 | Updated copyright notices to include the year 2017. | Stephan Bosch | -1/+1 | |
| 2016-12-16 | global: Make sure *_malloc() calculations won't cause integer overflows. | Timo Sirainen | -1/+3 | |
| 2016-11-02 | data-stack: t_push should always keep track of the marker | Josef 'Jeff' Sipek | -4/+2 | |
| Instead of only keeping track of it on DEBUG builds, t_push should always keep the marker around. This will help diagnosing issues on non-debug builds. | ||||
| 2016-10-06 | lib-test: Fixed assert-crash in test_exit() with --enable-static-checker | Timo Sirainen | -3/+9 | |
| Fixes: Panic: Missing t_pop() call | ||||
| 2016-09-08 | lib: Allow static analyzers to check for t_pop() leaks. | Timo Sirainen | -6/+20 | |
| They should be able to detect the missing free() call from code paths missing a t_pop(). | ||||
| 2016-09-02 | lib: If DEBUG is enabled, use a pointer type for data_stack_frame_t | Timo Sirainen | -1/+7 | |
| This allows telling static analyzers to treat t_push() and t_pop() similarly to malloc()/free() and check for leaks. | ||||
| 2016-09-02 | lib: Changed t_pop() API to make it a bit more like free() | Timo Sirainen | -13/+9 | |
| 2016-09-02 | lib: Created data_stack_frame_t type for data_stack_frame | Timo Sirainen | -6/+6 | |
| 2016-09-02 | lib: Small code cleanup to data-stack - use explicit data_stack_initialized | Timo Sirainen | -3/+5 | |
| This will make it easier to change data_stack_frame's type. | ||||
| 2016-09-02 | lib: Minor t_push() optimization - use unlikely() | Timo Sirainen | -1/+1 | |
| 2016-08-01 | lib,lib-test: i_warning to i_debug on alloc growing messages | Martti Rannanjärvi | -2/+2 | |
