1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/include/ruby
normal 7e669f40be ruby/ruby.h: remove unnecessary exports from C-API
Needlessly exporting can reduce performance locally and increase
binary size.

Increasing the footprint of our C-API larger is also detrimental
to our development as it encourages tighter coupling with our
internals; making it harder for us to preserve compatibility.

If some parts of the core codebase needs access to globals,
internal.h should be used instead of anything in include/ruby/*.

"Urabe, Shyouhei" <shyouhei@ruby-lang.org> wrote:
> On Thu, Jan 18, 2018 at 7:33 PM, Eric Wong <normalperson@yhbt.net> wrote:
> > shyouhei@ruby-lang.org wrote:
> >>   https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61908
> >>
> >>     export rb_mFConst
> >
> > Why are we exporting all these and making the public C-API bigger?
> > If anything, we should make these static.  Thanks.
>
> No concrete reason, except they have already been externed in 2.5.
> These variables had lacked declarations so far, which resulted in their
> visibility to be that of extern. The commit is just confirming the status quo.
>
> I'm not against to turn them into static.

This reverts changes from r61910, r61909, r61908, r61907, and r61906.

* transcode.c (rb_eUndefinedConversionError): make static
  (rb_eInvalidByteSequenceError): ditto
  (rb_eConverterNotFoundError): ditto
* process.c (rb_mProcGID, rb_mProcUid, rb_mProcID_Syscall): ditto
* file.c (rb_mFConst): ditto
* error.c (rb_mWarning, rb_cWarningBuffer): ditto
* enumerator.c (rb_cLazy): ditto
  [Misc ]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-24 21:07:14 +00:00
..
backward
backward.h vm.c: partially revert r60558 2017-12-01 12:26:40 +00:00
debug.h export rb_tracearg_callee_id(). 2017-11-16 07:41:33 +00:00
defines.h fix macro argument names inconsistency 2018-01-16 05:49:01 +00:00
encoding.h Include ruby/{io,encoding}.h before internal.h 2018-01-09 12:35:12 +00:00
intern.h suppress warning: 'const' attribute on function returning 'void' 2017-12-18 09:03:59 +00:00
io.h Include ruby/{io,encoding}.h before internal.h 2018-01-09 12:35:12 +00:00
missing.h INFINITY is float. That of double is HUGE_VAL. 2018-01-19 01:45:36 +00:00
onigmo.h Update to Onigmo 6.1.3-669ac9997619954c298da971fcfacccf36909d05. 2017-12-01 13:50:13 +00:00
oniguruma.h Merge Onigmo 6.0.0 2016-12-10 17:47:04 +00:00
re.h
regex.h
ruby.h ruby/ruby.h: remove unnecessary exports from C-API 2018-01-24 21:07:14 +00:00
st.h st.c: fix st_hash* functions [Bug ] 2016-12-21 06:22:16 +00:00
subst.h
thread.h
thread_native.h
util.h util.h: remove my_getcwd 2017-11-26 01:36:33 +00:00
version.h version.h (RUBY_VERSION): 2.6.0 development has started. 2017-12-25 14:05:59 +00:00
vm.h
win32.h undef previous definition of SIZEOF_STRUCT_STAT_ST_INO 2017-12-11 16:06:41 +00:00