1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

vm_core: use "int" for living_thread_num

We treat this as "int" through the vm_living_thread_num API
anyways, and "pid_t" is still 32-bits with glibc on 64-bit
platforms.  I expect it'll be a long time before anybody needs
more than 2 billion native threads.  For now, let's save one
cacheline on x86-64 (as reported by pahole(1)):

	before:  size: 1288, cachelines: 21, members: 45
	 after:  size: 1280, cachelines: 20, members: 45

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
normal 2018-01-27 21:04:36 +00:00
parent 6cb0126773
commit 72b7bd0af5
2 changed files with 2 additions and 2 deletions

View file

@ -194,7 +194,7 @@ vm_check_ints_blocking(rb_execution_context_t *ec)
static int
vm_living_thread_num(rb_vm_t *vm)
{
return (int)vm->living_thread_num;
return vm->living_thread_num;
}
#if THREAD_DEBUG

View file

@ -526,8 +526,8 @@ typedef struct rb_vm_struct {
struct list_head waiting_fds; /* <=> struct waiting_fd */
struct list_head living_threads;
size_t living_thread_num;
VALUE thgroup_default;
int living_thread_num;
unsigned int running: 1;
unsigned int thread_abort_on_exception: 1;