From 7e669f40bed629ac746ac62ece63e3d4ce6ff039 Mon Sep 17 00:00:00 2001 From: normal Date: Wed, 24 Jan 2018 21:07:14 +0000 Subject: 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" wrote: > On Thu, Jan 18, 2018 at 7:33 PM, Eric Wong 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 #14381] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- include/ruby/ruby.h | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'include/ruby/ruby.h') diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 1a1c6bd4a8..bd635f3b7c 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -1905,18 +1905,12 @@ RUBY_EXTERN VALUE rb_mKernel; RUBY_EXTERN VALUE rb_mComparable; RUBY_EXTERN VALUE rb_mEnumerable; RUBY_EXTERN VALUE rb_mErrno; -RUBY_EXTERN VALUE rb_mFConst; RUBY_EXTERN VALUE rb_mFileTest; RUBY_EXTERN VALUE rb_mGC; RUBY_EXTERN VALUE rb_mMath; -RUBY_EXTERN VALUE rb_mProcGID; -RUBY_EXTERN VALUE rb_mProcID_Syscall; -RUBY_EXTERN VALUE rb_mProcUID; RUBY_EXTERN VALUE rb_mProcess; RUBY_EXTERN VALUE rb_mWaitReadable; RUBY_EXTERN VALUE rb_mWaitWritable; -RUBY_EXTERN VALUE rb_mWarning; -RUBY_EXTERN VALUE rb_cWarningBuffer; RUBY_EXTERN VALUE rb_cBasicObject; RUBY_EXTERN VALUE rb_cObject; @@ -1941,7 +1935,6 @@ RUBY_EXTERN VALUE rb_cFloat; RUBY_EXTERN VALUE rb_cHash; RUBY_EXTERN VALUE rb_cIO; RUBY_EXTERN VALUE rb_cInteger; -RUBY_EXTERN VALUE rb_cLazy; RUBY_EXTERN VALUE rb_cMatch; RUBY_EXTERN VALUE rb_cMethod; RUBY_EXTERN VALUE rb_cModule; @@ -1991,9 +1984,6 @@ RUBY_EXTERN VALUE rb_eSysStackError; RUBY_EXTERN VALUE rb_eRegexpError; RUBY_EXTERN VALUE rb_eEncodingError; RUBY_EXTERN VALUE rb_eEncCompatError; -RUBY_EXTERN VALUE rb_eUndefinedConversionError; -RUBY_EXTERN VALUE rb_eInvalidByteSequenceError; -RUBY_EXTERN VALUE rb_eConverterNotFoundError; RUBY_EXTERN VALUE rb_eScriptError; RUBY_EXTERN VALUE rb_eNameError; -- cgit v1.2.3