Browse Source

Add JackTools::InitOS.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4574 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/1.9.8
sletz 14 years ago
parent
commit
57df5447e0
3 changed files with 25 additions and 5 deletions
  1. +3
    -0
      common/JackControlAPI.cpp
  2. +17
    -2
      common/JackTools.cpp
  3. +5
    -3
      common/JackTools.h

+ 3
- 0
common/JackControlAPI.cpp View File

@@ -900,6 +900,9 @@ jackctl_server_open(
jack_cleanup_shm();
JackTools::CleanupFiles(server_ptr->name.str);

// OS specific initialisations
JackTools::InitOS();

if (!server_ptr->realtime.b && server_ptr->client_timeout.i == 0) {
server_ptr->client_timeout.i = 500; /* 0.5 sec; usable when non realtime. */
}


+ 17
- 2
common/JackTools.cpp View File

@@ -43,11 +43,11 @@ namespace Jack {
#endif
}

void JackTools::ThrowJackNetException()
void JackTools::ThrowJackNetException()
{
throw JackNetException();
}
int JackTools::MkDir(const char* path)
{
#ifdef WIN32
@@ -237,6 +237,21 @@ namespace Jack {
new_name[i] = '\0';
}

void JackTools::InitOS()
{
#ifdef WIN32
SIZE_T dwMin, dwMax;
HANDLE hProcess = GetCurrentProcess();
if (!GetProcessWorkingSetSize(hProcess, &dwMin, &dwMax)) {
jack_error("GetProcessWorkingSetSize failed (%d)", GetLastError());
} else if (!SetProcessWorkingSetSize(hProcess, dwMin, dwMax * 5)) {
jack_error("SetProcessWorkingSetSize failed (%d)", GetLastError());
} else {
jack_info("SetProcessWorkingSetSize min = %d max = %d", dwMin, dwMax * 5);
}
#endif
}

#ifdef WIN32

void BuildClientPath(char* path_to_so, int path_len, const char* so_name)


+ 5
- 3
common/JackTools.h View File

@@ -63,11 +63,13 @@ namespace Jack

static int MkDir(const char* path);
static char* UserDir();
static char* ServerDir ( const char* server_name, char* server_dir );
static char* ServerDir(const char* server_name, char* server_dir);
static const char* DefaultServerName();
static void CleanupFiles ( const char* server_name );
static void CleanupFiles(const char* server_name);
static int GetTmpdir();
static void RewriteName ( const char* name, char* new_name );
static void RewriteName(const char* name, char* new_name);

static void InitOS();

static void ThrowJackNetException();



Loading…
Cancel
Save