ruby-changes:46505
From: nagachika <ko1@a...>
Date: Tue, 9 May 2017 23:48:54 +0900 (JST)
Subject: [ruby-changes:46505] nagachika:r58626 (ruby_2_4): merge revision(s) 57180: [Backport #13247]
nagachika 2017-05-09 23:48:49 +0900 (Tue, 09 May 2017) New Revision: 58626 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58626 Log: merge revision(s) 57180: [Backport #13247] memory_status.c: support old Mac OS * ext/-test-/memory_status/memory_status.c (read_status): use TASK_BASIC_INFO instead of MACH_TASK_BASIC_INFO on old Mac OS. Modified directories: branches/ruby_2_4/ Modified files: branches/ruby_2_4/ext/-test-/memory_status/memory_status.c branches/ruby_2_4/version.h Index: ruby_2_4/version.h =================================================================== --- ruby_2_4/version.h (revision 58625) +++ ruby_2_4/version.h (revision 58626) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_4/version.h#L1 #define RUBY_VERSION "2.4.2" #define RUBY_RELEASE_DATE "2017-05-09" -#define RUBY_PATCHLEVEL 120 +#define RUBY_PATCHLEVEL 121 #define RUBY_RELEASE_YEAR 2017 #define RUBY_RELEASE_MONTH 5 Index: ruby_2_4/ext/-test-/memory_status/memory_status.c =================================================================== --- ruby_2_4/ext/-test-/memory_status/memory_status.c (revision 58625) +++ ruby_2_4/ext/-test-/memory_status/memory_status.c (revision 58626) @@ -17,12 +17,19 @@ read_status(VALUE self) https://github.com/ruby/ruby/blob/trunk/ruby_2_4/ext/-test-/memory_status/memory_status.c#L17 #if defined __APPLE__ VALUE rss; kern_return_t error; - mach_msg_type_number_t out_count; +# if defined MACH_TASK_BASIC_INFO + const task_flavor_t flavor = MACH_TASK_BASIC_INFO; + mach_msg_type_number_t out_count = MACH_TASK_BASIC_INFO_COUNT; mach_task_basic_info_data_t taskinfo; +# else + const task_flavor_t flavor = TASK_BASIC_INFO; + mach_msg_type_number_t out_count = TASK_BASIC_INFO_COUNT; + task_basic_info_data_t taskinfo; +# endif taskinfo.virtual_size = 0; - out_count = MACH_TASK_BASIC_INFO_COUNT; - error = task_info(mach_task_self(), MACH_TASK_BASIC_INFO, + taskinfo.resident_size = 0; + error = task_info(mach_task_self(), flavor, (task_info_t)&taskinfo, &out_count); if (error != KERN_SUCCESS) return Qnil; size = ULL2NUM(taskinfo.virtual_size); Index: ruby_2_4 =================================================================== --- ruby_2_4 (revision 58625) +++ ruby_2_4 (revision 58626) Property changes on: ruby_2_4 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /trunk:r57180 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/