149 static void pd_free_memory(char *addr, size_t bytes, size_t alignment_hint); |
149 static void pd_free_memory(char *addr, size_t bytes, size_t alignment_hint); |
150 static void pd_realign_memory(char *addr, size_t bytes, size_t alignment_hint); |
150 static void pd_realign_memory(char *addr, size_t bytes, size_t alignment_hint); |
151 |
151 |
152 static size_t page_size_for_region(size_t region_size, size_t min_pages, bool must_be_aligned); |
152 static size_t page_size_for_region(size_t region_size, size_t min_pages, bool must_be_aligned); |
153 |
153 |
|
154 static void initialize_initial_active_processor_count(); |
154 public: |
155 public: |
155 static void init(void); // Called before command line parsing |
156 static void init(void); // Called before command line parsing |
156 static void init_before_ergo(void); // Called after command line parsing |
157 static void init_before_ergo(void); // Called after command line parsing |
157 // before VM ergonomics processing. |
158 // before VM ergonomics processing. |
158 static jint init_2(void); // Called after command line parsing |
159 static jint init_2(void); // Called after command line parsing |
235 static void set_processor_count(int count) { _processor_count = count; } |
236 static void set_processor_count(int count) { _processor_count = count; } |
236 |
237 |
237 // Returns the number of CPUs this process is currently allowed to run on. |
238 // Returns the number of CPUs this process is currently allowed to run on. |
238 // Note that on some OSes this can change dynamically. |
239 // Note that on some OSes this can change dynamically. |
239 static int active_processor_count(); |
240 static int active_processor_count(); |
|
241 |
|
242 // At startup the number of active CPUs this process is allowed to run on. |
|
243 // This value does not change dynamically. May be different from active_processor_count(). |
|
244 static int initial_active_processor_count() { |
|
245 assert(_initial_active_processor_count > 0, "Initial active processor count not set yet."); |
|
246 return _initial_active_processor_count; |
|
247 } |
240 |
248 |
241 // Bind processes to processors. |
249 // Bind processes to processors. |
242 // This is a two step procedure: |
250 // This is a two step procedure: |
243 // first you generate a distribution of processes to processors, |
251 // first you generate a distribution of processes to processors, |
244 // then you bind processes according to that distribution. |
252 // then you bind processes according to that distribution. |