resurrected some bit-rotting debug code. Might become useful one day.

2004-07-13  Sven Neumann  <sven@gimp.org>

	* app/core/gimpimage-undo.c: resurrected some bit-rotting debug
	code. Might become useful one day.
This commit is contained in:
Sven Neumann 2004-07-13 08:30:22 +00:00 committed by Sven Neumann
parent 3aff97c3aa
commit 5cff101603
2 changed files with 28 additions and 26 deletions

View File

@ -1,3 +1,8 @@
2004-07-13 Sven Neumann <sven@gimp.org>
* app/core/gimpimage-undo.c: resurrected some bit-rotting debug
code. Might become useful one day.
2004-07-13 Sven Neumann <sven@gimp.org> 2004-07-13 Sven Neumann <sven@gimp.org>
* autogen.sh: when automake 1.8 is being used, require at least * autogen.sh: when automake 1.8 is being used, require at least

View File

@ -147,8 +147,7 @@ gimp_image_undo_group_start (GimpImage *gimage,
gimp_object_set_name (GIMP_OBJECT (undo_group), name); gimp_object_set_name (GIMP_OBJECT (undo_group), name);
GIMP_UNDO (undo_group)->undo_type = type; GIMP_UNDO (undo_group)->undo_type = type;
gimp_undo_stack_push_undo (gimage->undo_stack, gimp_undo_stack_push_undo (gimage->undo_stack, GIMP_UNDO (undo_group));
GIMP_UNDO (undo_group));
gimage->pushing_undo_group = type; gimage->pushing_undo_group = type;
@ -338,10 +337,10 @@ gimp_image_undo_free_space (GimpImage *gimage)
max_undo_levels = 1024; /* FIXME */ max_undo_levels = 1024; /* FIXME */
undo_size = gimage->gimp->config->undo_size; undo_size = gimage->gimp->config->undo_size;
#if 0 #ifdef DEBUG_IMAGE_UNDO
g_print ("undo_steps: %d undo_bytes: %d\n", g_printerr ("undo_steps: %d undo_bytes: %ld\n",
gimp_container_num_children (container), gimp_container_num_children (container),
gimp_object_get_memsize (GIMP_OBJECT (container), NULL)); (glong) gimp_object_get_memsize (GIMP_OBJECT (container), NULL));
#endif #endif
/* keep at least min_undo_levels undo steps */ /* keep at least min_undo_levels undo steps */
@ -351,15 +350,14 @@ gimp_image_undo_free_space (GimpImage *gimage)
while ((gimp_object_get_memsize (GIMP_OBJECT (container), NULL) > undo_size) || while ((gimp_object_get_memsize (GIMP_OBJECT (container), NULL) > undo_size) ||
(gimp_container_num_children (container) > max_undo_levels)) (gimp_container_num_children (container) > max_undo_levels))
{ {
GimpUndo *freed; GimpUndo *freed = gimp_undo_stack_free_bottom (gimage->undo_stack,
GIMP_UNDO_MODE_UNDO);
freed = gimp_undo_stack_free_bottom (gimage->undo_stack, #ifdef DEBUG_IMAGE_UNDO
GIMP_UNDO_MODE_UNDO); g_printerr ("freed one step: undo_steps: %d undo_bytes: %ld\n",
gimp_container_num_children (container),
#if 0 (glong) gimp_object_get_memsize (GIMP_OBJECT (container),
g_print ("freed one step: undo_steps: %d undo_bytes: %d\n", NULL));
gimp_container_num_children (container),
gimp_object_get_memsize (GIMP_OBJECT (container), NULL));
#endif #endif
gimp_image_undo_event (gimage, GIMP_UNDO_EVENT_UNDO_EXPIRED, freed); gimp_image_undo_event (gimage, GIMP_UNDO_EVENT_UNDO_EXPIRED, freed);
@ -378,23 +376,22 @@ gimp_image_undo_free_redo (GimpImage *gimage)
container = gimage->redo_stack->undos; container = gimage->redo_stack->undos;
#if 0 #ifdef DEBUG_IMAGE_UNDO
g_print ("redo_steps: %d redo_bytes: %d\n", g_printerr ("redo_steps: %d redo_bytes: %ld\n",
gimp_container_num_children (container), gimp_container_num_children (container),
gimp_object_get_memsize (GIMP_OBJECT (container)), NULL); (glong) gimp_object_get_memsize (GIMP_OBJECT (container), NULL));
#endif #endif
while (gimp_container_num_children (container) > 0) while (gimp_container_num_children (container) > 0)
{ {
GimpUndo *freed; GimpUndo *freed = gimp_undo_stack_free_bottom (gimage->redo_stack,
GIMP_UNDO_MODE_REDO);
freed = gimp_undo_stack_free_bottom (gimage->redo_stack, #ifdef DEBUG_IMAGE_UNDO
GIMP_UNDO_MODE_REDO); g_printerr ("freed one step: redo_steps: %d redo_bytes: %ld\n",
gimp_container_num_children (container),
#if 0 (glong )gimp_object_get_memsize (GIMP_OBJECT (container),
g_print ("freed one step: redo_steps: %d redo_bytes: %d\n", NULL));
gimp_container_num_children (container),
gimp_object_get_memsize (GIMP_OBJECT (container)), NULL);
#endif #endif
gimp_image_undo_event (gimage, GIMP_UNDO_EVENT_REDO_EXPIRED, freed); gimp_image_undo_event (gimage, GIMP_UNDO_EVENT_REDO_EXPIRED, freed);