Reduced allocated stack sizes. Trims about 13MB of memory consumption.

git-svn-id: svn://localhost/ardour2/trunk@1293 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2007-01-10 03:26:22 +00:00
parent 5c7a3c680b
commit 2d62ded1aa
5 changed files with 29 additions and 1 deletions

View file

@ -837,6 +837,8 @@ if env['SYSLIBS']:
# libraries['flowcanvas'] = LibraryInfo(LIBS='flowcanvas', LIBPATH='#/libs/flowcanvas', CPPPATH='#libs/flowcanvas')
libraries['soundtouch'] = LibraryInfo()
libraries['soundtouch'].ParseConfig ('pkg-config --cflags --libs soundtouch-1.0')
# Comment the previous line and uncomment this for Debian:
#libraries['soundtouch'].ParseConfig ('pkg-config --cflags --libs libSoundTouch')
libraries['appleutility'] = LibraryInfo(LIBS='libappleutility',
LIBPATH='#libs/appleutility',

View file

@ -2780,8 +2780,14 @@ Editor::freeze_route ()
itt.cancel = false;
itt.progress = 0.0f;
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_attr_setstacksize(&attr, 500000);
pthread_create (&itt.thread, 0, _freeze_thread, this);
pthread_attr_destroy(&attr);
track_canvas.get_window()->set_cursor (Gdk::Cursor (Gdk::WATCH));
while (!itt.done && !itt.cancel) {

View file

@ -399,7 +399,8 @@ void
AudioEngine::start_metering_thread ()
{
if (m_meter_thread == 0) {
m_meter_thread = Glib::Thread::create (sigc::mem_fun(this, &AudioEngine::meter_thread), true);
m_meter_thread = Glib::Thread::create (sigc::mem_fun(this, &AudioEngine::meter_thread),
500000, true, true, Glib::THREAD_PRIORITY_NORMAL);
}
}

View file

@ -199,10 +199,15 @@ OSC::init_osc_thread ()
return false;
}
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_attr_setstacksize(&attr, 500000);
pthread_create (&_osc_thread, NULL, &OSC::_osc_receiver, this);
if (!_osc_thread) {
return false;
}
pthread_attr_destroy(&attr);
//pthread_detach (_osc_thread);
return true;

View file

@ -43,6 +43,16 @@ pthread_create_and_store (string name, pthread_t *thread, pthread_attr_t *attr,
{
int ret;
pthread_attr_t default_attr;
bool use_default_attr = (attr == NULL);
if (use_default_attr) {
// set default stack size to sensible default for memlocking
pthread_attr_init(&default_attr);
pthread_attr_setstacksize(&default_attr, 500000);
attr = &default_attr;
}
if ((ret = pthread_create (thread, attr, start_routine, arg)) == 0) {
std::pair<string,pthread_t> newpair;
newpair.first = name;
@ -54,6 +64,10 @@ pthread_create_and_store (string name, pthread_t *thread, pthread_attr_t *attr,
pthread_mutex_unlock (&thread_map_lock);
}
if (use_default_attr) {
pthread_attr_destroy(&default_attr);
}
return ret;
}