Cleanup: follow our API naming conventions

Minor changes to recently added undo API call.
This commit is contained in:
Campbell Barton
2025-09-11 12:59:32 +10:00
parent 77c76ccdb8
commit 1e7587f761
3 changed files with 7 additions and 10 deletions

View File

@@ -157,4 +157,4 @@ void ED_undosys_stack_memfile_id_changed_tag(UndoStack *ustack, ID *id);
*
* \return Total memory usage in bytes, or 0 if no undo stack is available.
*/
size_t ED_get_total_undo_memory();
size_t ED_undosys_total_memory_calc(UndoStack *ustack);

View File

@@ -913,13 +913,8 @@ Vector<Base *> ED_undo_editmode_bases_from_view_layer(const Scene *scene, ViewLa
return bases;
}
size_t ED_get_total_undo_memory()
size_t ED_undosys_total_memory_calc(UndoStack *ustack)
{
UndoStack *ustack = ED_undo_stack_get();
if (!ustack) {
return 0;
}
size_t total_memory = 0;
for (UndoStep *us = static_cast<UndoStep *>(ustack->steps.first); us != nullptr; us = us->next) {

View File

@@ -659,9 +659,11 @@ PyDoc_STRVAR(
static PyObject *bpy_app_undo_memory_info(PyObject * /*self*/, PyObject * /*args*/)
{
size_t total_memory = ED_get_total_undo_memory();
size_t total_memory = 0;
UndoStack *ustack = ED_undo_stack_get();
if (ustack) {
total_memory = ED_undosys_total_memory_calc(ustack);
}
return PyLong_FromSize_t(total_memory);
}