diff --git a/source/blender/blenkernel/intern/undo_system.cc b/source/blender/blenkernel/intern/undo_system.cc index 1fce7d6500c..c2bffa423d4 100644 --- a/source/blender/blenkernel/intern/undo_system.cc +++ b/source/blender/blenkernel/intern/undo_system.cc @@ -384,7 +384,7 @@ UndoStep *BKE_undosys_stack_init_or_active_with_type(UndoStack *ustack, const Un void BKE_undosys_stack_limit_steps_and_memory(UndoStack *ustack, int steps, size_t memory_limit) { UNDO_NESTED_ASSERT(false); - if ((steps == -1) && (memory_limit != 0)) { + if ((steps == -1) && (memory_limit == 0)) { return; } @@ -398,6 +398,12 @@ void BKE_undosys_stack_limit_steps_and_memory(UndoStack *ustack, int steps, size if (memory_limit) { data_size_all += us->data_size; if (data_size_all > memory_limit) { + CLOG_INFO(&LOG, + 1, + "At step %zu: data_size_all=%zu >= memory_limit=%zu", + us_count, + data_size_all, + memory_limit); break; } } @@ -411,6 +417,8 @@ void BKE_undosys_stack_limit_steps_and_memory(UndoStack *ustack, int steps, size } } + CLOG_INFO(&LOG, 1, "Total steps %zu: data_size_all=%zu", us_count, data_size_all); + if (us) { #ifdef WITH_GLOBAL_UNDO_KEEP_ONE /* Hack, we need to keep at least one BKE_UNDOSYS_TYPE_MEMFILE. */