mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
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:
parent
5c7a3c680b
commit
2d62ded1aa
5 changed files with 29 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
@ -53,6 +63,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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue