Project

General

Profile

Misc #15305 ยป 0001-include-ruby-ruby.h-RB_ALLOCV-remove-unnecessary-GC-.patch

normalperson (Eric Wong), 11/15/2018 09:46 AM

View differences:

include/ruby/ruby.h
1714 1714
#else
1715 1715
# define RUBY_ALLOCV_LIMIT 1024
1716 1716
# define RB_ALLOCV(v, n) ((n) < RUBY_ALLOCV_LIMIT ? \
1717
		       (RB_GC_GUARD(v) = 0, alloca(n)) : \
1717
		       ((v) = 0, alloca(n)) : \
1718 1718
		       rb_alloc_tmp_buffer(&(v), (n)))
1719 1719
# define RB_ALLOCV_N(type, v, n) \
1720 1720
    ((type*)(((size_t)(n) < RUBY_ALLOCV_LIMIT / sizeof(type)) ? \
1721
	     (RB_GC_GUARD(v) = 0, alloca((size_t)(n) * sizeof(type))) : \
1721
	     ((v) = 0, alloca((size_t)(n) * sizeof(type))) : \
1722 1722
	     rb_alloc_tmp_buffer2(&(v), (long)(n), sizeof(type))))
1723 1723
#endif
1724 1724
#define RB_ALLOCV_END(v) rb_free_tmp_buffer(&(v))
1725
-