Module: NewRelic::LanguageSupport::DataSerialization

Included in:
DataSerialization
Defined in:
lib/new_relic/language_support.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/new_relic/language_support.rb', line 5

def self.included(base)
  # need to disable GC during marshal load in 1.8.7
  if NewRelic::LanguageSupport.using_version?('1.8.7') &&
      !NewRelic::LanguageSupport.using_engine?('jruby') &&
      !NewRelic::LanguageSupport.using_engine?('rbx')
    base.class_eval do
      def self.load(*args)
        if defined?(::GC) && ::GC.respond_to?(:disable)
          ::GC.disable
          val = super
          ::GC.enable
          val
        else
          super
        end
      end
    end
  end
end