diff options
| author | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2023-06-21 00:00:00 +0000 |
|---|---|---|
| committer | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2023-12-17 14:59:19 +0500 |
| commit | 5b39dc76f1bc82f941d5c800ab9f34407a06b53a (patch) | |
| tree | fe5e17420300b715021a76328444088d32047963 /CPP/Windows/System.h | |
| parent | 93be7d4abfd4233228f58ee1fbbcd76d91be66a4 (diff) | |
| download | 7zip-5b39dc76f1bc82f941d5c800ab9f34407a06b53a.tar.gz 7zip-5b39dc76f1bc82f941d5c800ab9f34407a06b53a.tar.bz2 7zip-5b39dc76f1bc82f941d5c800ab9f34407a06b53a.zip | |
23.0123.01
Diffstat (limited to 'CPP/Windows/System.h')
| -rw-r--r-- | CPP/Windows/System.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/CPP/Windows/System.h b/CPP/Windows/System.h index 23cb0da..0650007 100644 --- a/CPP/Windows/System.h +++ b/CPP/Windows/System.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | // Windows/System.h | 1 | // Windows/System.h |
| 2 | 2 | ||
| 3 | #ifndef __WINDOWS_SYSTEM_H | 3 | #ifndef ZIP7_INC_WINDOWS_SYSTEM_H |
| 4 | #define __WINDOWS_SYSTEM_H | 4 | #define ZIP7_INC_WINDOWS_SYSTEM_H |
| 5 | 5 | ||
| 6 | #ifndef _WIN32 | 6 | #ifndef _WIN32 |
| 7 | // #include <sched.h> | 7 | // #include <sched.h> |
| @@ -9,11 +9,11 @@ | |||
| 9 | #endif | 9 | #endif |
| 10 | 10 | ||
| 11 | #include "../Common/MyTypes.h" | 11 | #include "../Common/MyTypes.h" |
| 12 | #include "../Common/MyWindows.h" | ||
| 12 | 13 | ||
| 13 | namespace NWindows { | 14 | namespace NWindows { |
| 14 | namespace NSystem { | 15 | namespace NSystem { |
| 15 | 16 | ||
| 16 | |||
| 17 | #ifdef _WIN32 | 17 | #ifdef _WIN32 |
| 18 | 18 | ||
| 19 | UInt32 CountAffinity(DWORD_PTR mask); | 19 | UInt32 CountAffinity(DWORD_PTR mask); |
| @@ -64,7 +64,7 @@ struct CProcessAffinity | |||
| 64 | UInt32 GetNumSystemThreads() const { return (UInt32)numSysThreads; } | 64 | UInt32 GetNumSystemThreads() const { return (UInt32)numSysThreads; } |
| 65 | BOOL Get(); | 65 | BOOL Get(); |
| 66 | 66 | ||
| 67 | #ifdef _7ZIP_AFFINITY_SUPPORTED | 67 | #ifdef Z7_AFFINITY_SUPPORTED |
| 68 | 68 | ||
| 69 | CCpuSet cpu_set; | 69 | CCpuSet cpu_set; |
| 70 | 70 | ||
| @@ -86,7 +86,7 @@ struct CProcessAffinity | |||
| 86 | return sched_setaffinity(0, sizeof(cpu_set), &cpu_set) == 0; | 86 | return sched_setaffinity(0, sizeof(cpu_set), &cpu_set) == 0; |
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | #else | 89 | #else // Z7_AFFINITY_SUPPORTED |
| 90 | 90 | ||
| 91 | void InitST() | 91 | void InitST() |
| 92 | { | 92 | { |
| @@ -114,16 +114,19 @@ struct CProcessAffinity | |||
| 114 | return FALSE; | 114 | return FALSE; |
| 115 | } | 115 | } |
| 116 | 116 | ||
| 117 | #endif | 117 | #endif // Z7_AFFINITY_SUPPORTED |
| 118 | }; | 118 | }; |
| 119 | 119 | ||
| 120 | #endif | 120 | #endif // _WIN32 |
| 121 | 121 | ||
| 122 | 122 | ||
| 123 | UInt32 GetNumberOfProcessors(); | 123 | UInt32 GetNumberOfProcessors(); |
| 124 | 124 | ||
| 125 | bool GetRamSize(UInt64 &size); // returns false, if unknown ram size | 125 | bool GetRamSize(UInt64 &size); // returns false, if unknown ram size |
| 126 | 126 | ||
| 127 | unsigned long Get_File_OPEN_MAX(); | ||
| 128 | unsigned Get_File_OPEN_MAX_Reduced_for_3_tasks(); | ||
| 129 | |||
| 127 | }} | 130 | }} |
| 128 | 131 | ||
| 129 | #endif | 132 | #endif |
