Permalink
Browse files

Merge branch 'master' into refactoring

Conflicts:
	NEWS
	ext/oxt/thread.hpp
  • Loading branch information...
2 parents ca4230d + a6dc716 commit 20005e1459841c69c8ea7f1b2432eee2856238a7 @FooBarWidget FooBarWidget committed Sep 12, 2009
Showing with 22 additions and 14 deletions.
  1. +7 −0 NEWS
  2. +3 −3 bin/passenger-memory-stats
  3. +12 −11 ext/oxt/thread.hpp
View
7 NEWS
@@ -4,6 +4,13 @@ Release 3.0.0
* Caveat: command line tools are not compatible with earlier Phusion
Passenger versions, so do not attempt this!
+
+Release 2.2.6
+-------------
+
+ * Fixed a compilation problem on Solaris. Issue #369.
+
+
Release 2.2.5
-------------
View
6 bin/passenger-memory-stats
@@ -76,7 +76,7 @@ class Table
left_bar_size = free_space / 2
right_bar_size = free_space - left_bar_size
end
- result = "#{BLUE_BG}#{BOLD}#{YELLOW}"
+ result = "#{BLUE_BG}#{BOLD}#{YELLOW}\n"
result << "#{"-" * left_bar_size} #{title} #{"-" * right_bar_size}\n"
if !@rows.empty?
result << WHITE
@@ -124,7 +124,7 @@ class MemoryStats
end
def to_a
- return [pid, ppid, threads, vm_size_in_mb, private_dirty_rss_in_mb, rss_in_mb, name]
+ return [pid, ppid, vm_size_in_mb, private_dirty_rss_in_mb, rss_in_mb, name]
end
end
@@ -264,7 +264,7 @@ private
end
def print_process_list(title, processes, options = {})
- table = Table.new(%w{PID PPID Threads VMSize Private Resident Name})
+ table = Table.new(%w{PID PPID VMSize Private Resident Name})
table.add_rows(processes)
if options.has_key?(:show_ppid) && !options[:show_ppid]
table.remove_column('PPID')
View
23 ext/oxt/thread.hpp
@@ -109,15 +109,6 @@ class thread: public boost::thread {
public:
/**
- * The platform's minimum stack size, in bytes.
- */
- #if defined(PTHREAD_STACK_MIN)
- static const unsigned int MIN_STACK_SIZE = PTHREAD_STACK_MIN;
- #else
- static const unsigned int MIN_STACK_SIZE = 1024 * 128;
- #endif
-
- /**
* Create a new thread.
*
* @param func A function object which will be called as the thread's
@@ -139,8 +130,18 @@ class thread: public boost::thread {
initialize_data(name);
set_thread_main_function(boost::bind(thread_main, func, data));
- if (stack_size != 0 && stack_size < MIN_STACK_SIZE) {
- stack_size = MIN_STACK_SIZE;
+
+ unsigned long min_stack_size;
+ #ifdef PTHREAD_STACK_MIN
+ // PTHREAD_STACK_MIN may not be a constant macro so we need
+ // to evaluate it dynamically.
+ min_stack_size = PTHREAD_STACK_MIN;
+ #else
+ // Assume minimum stack size is 128 KB.
+ min_stack_size = 128 * 1024;
+ #endif
+ if (stack_size != 0 && stack_size < min_stack_size) {
+ stack_size = min_stack_size;
}
start_thread(stack_size);
}

0 comments on commit 20005e1

Please sign in to comment.