From dd06154ed66cfca4055a6ee1aecb59025ebaa4d4 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Thu, 5 Jun 2008 12:48:53 +0000 Subject: [PATCH] heavily optimized journal-cleanup - project unloading is now unbelievable fast git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1073 0778d3d1-df1d-0410-868b-ea421aaaa00d --- ChangeLog | 12 ++++++++++++ configure.in | 4 ++-- include/project_journal.h | 10 ++-------- src/core/project_journal.cpp | 11 +++++------ src/core/song.cpp | 1 - 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index c4a0901ed..dfb873337 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-06-05 Tobias Doerffel + + * include/note.h: + * include/note_play_handle.h: + removed obsolete FASTCALL-attributes + + * include/project_journal.h: + * src/core/project_journal.cpp: + * src/core/song.cpp: + heavily optimized journal-cleanup - project unloading is now + unbelievable fast! + 2008-06-05 Paul Giblock * data/themes/default/style.css: diff --git a/configure.in b/configure.in index cc692f9ca..11b3c1137 100644 --- a/configure.in +++ b/configure.in @@ -2,8 +2,8 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.50) -AC_INIT(lmms, 0.4.0-svn20080604, lmms-devel/at/lists/dot/sf/dot/net) -AM_INIT_AUTOMAKE(lmms, 0.4.0-svn20080604) +AC_INIT(lmms, 0.4.0-svn20080605, lmms-devel/at/lists/dot/sf/dot/net) +AM_INIT_AUTOMAKE(lmms, 0.4.0-svn20080605) AM_CONFIG_HEADER(config.h) diff --git a/include/project_journal.h b/include/project_journal.h index 782886a0e..edf8062ca 100644 --- a/include/project_journal.h +++ b/include/project_journal.h @@ -1,7 +1,7 @@ /* * project_journal.h - declaration of class projectJournal * - * Copyright (c) 2006-2007 Tobias Doerffel + * Copyright (c) 2006-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -78,13 +78,7 @@ public: // journalling information about the ID get's lost void forgetAboutID( const jo_id_t _id ); - void clearJournal( void ) - { - m_journalEntries.clear(); - m_currentJournalEntry = m_journalEntries.end(); - } - - void clearInvalidJournallingObjects( void ); + void clearJournal( void ); journallingObject * getJournallingObject( const jo_id_t _id ) { diff --git a/src/core/project_journal.cpp b/src/core/project_journal.cpp index c460e19ec..d1299e511 100644 --- a/src/core/project_journal.cpp +++ b/src/core/project_journal.cpp @@ -105,8 +105,7 @@ void projectJournal::journalEntryAdded( const jo_id_t _id ) jo_id_t projectJournal::allocID( journallingObject * _obj ) { - const jo_id_t EO_ID_MAX = 1 << 20; - + const jo_id_t EO_ID_MAX = 1 << 24; jo_id_t id; while( m_joIDs.contains( id = static_cast( (float) rand() / RAND_MAX * EO_ID_MAX ) ) ) @@ -151,21 +150,21 @@ void projectJournal::forgetAboutID( const jo_id_t _id ) -void projectJournal::clearInvalidJournallingObjects( void ) +void projectJournal::clearJournal( void ) { + m_journalEntries.clear(); + m_currentJournalEntry = m_journalEntries.end(); for( joIDMap::iterator it = m_joIDs.begin(); it != m_joIDs.end(); ) { if( it.value() == NULL ) { - forgetAboutID( it.key() ); - it = m_joIDs.begin(); + it = m_joIDs.erase( it ); } else { ++it; } } - //clearJournal(); } diff --git a/src/core/song.cpp b/src/core/song.cpp index f278162ea..068a2b83a 100644 --- a/src/core/song.cpp +++ b/src/core/song.cpp @@ -730,7 +730,6 @@ void song::clearProject( void ) emit dataChanged(); - engine::getProjectJournal()->clearInvalidJournallingObjects(); engine::getProjectJournal()->clearJournal(); engine::getProjectJournal()->setJournalling( TRUE );