Reduce buffer size to 20, add "deleting" to the log

This commit is contained in:
2025-10-09 19:32:33 +02:00
committed by jabber.developer2
parent 74cfd32c1e
commit 0c80d2101e

View File

@@ -98,7 +98,8 @@ _buffer_add(ProfBuff buffer, const char* show_char, int pad_indent, GDateTime* t
buffer->lines += e->_lines;
// With 10% margin to ensure overflow prevention
while (buffer->lines >= PAD_SIZE - (PAD_SIZE / 10) && g_slist_length(buffer->entries) > 1) {
while (buffer->lines >= 20 && g_slist_length(buffer->entries) > 1) {
log_debug("DELETING");
// Delete message from the opposite size to free buffer
GSList* buffer_entry_to_delete = append ? buffer->entries : g_slist_last(buffer->entries);
ProfBuffEntry* entry_to_delete = (ProfBuffEntry*)buffer_entry_to_delete->data;