Sha256: bd27b134bc4c2350a6c46dbdfb1a5973cfb0099b1c3a225fb8ea84a25f7a5a79

Contents?: true

Size: 823 Bytes

Versions: 110

Compression:

Stored size: 823 Bytes

Contents

# Protocol Buffers - Google's data interchange format
# Copyright 2022 Google Inc.  All rights reserved.
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd

module Google
  module Protobuf
    private

    SIZEOF_LONG = ::FFI::MemoryPointer.new(:long).size
    SIZEOF_VALUE = ::FFI::Pointer::SIZE

    def self.interpreter_supports_non_finalized_keys_in_weak_map?
      ! defined? JRUBY_VERSION
    end

    def self.cache_implementation
      if interpreter_supports_non_finalized_keys_in_weak_map? and SIZEOF_LONG >= SIZEOF_VALUE
        Google::Protobuf::ObjectCache
      else
        Google::Protobuf::LegacyObjectCache
      end
    end

    public
    OBJECT_CACHE = cache_implementation.new
  end
end

Version data entries

110 entries across 110 versions & 1 rubygems

Version Path
google-protobuf-3.25.6-java lib/google/protobuf/ffi/object_cache.rb
google-protobuf-3.25.6 lib/google/protobuf/ffi/object_cache.rb
google-protobuf-3.25.6-x86_64-linux lib/google/protobuf/ffi/object_cache.rb
google-protobuf-3.25.6-x86_64-darwin lib/google/protobuf/ffi/object_cache.rb
google-protobuf-3.25.6-x86-mingw32 lib/google/protobuf/ffi/object_cache.rb
google-protobuf-3.25.6-x86-linux lib/google/protobuf/ffi/object_cache.rb
google-protobuf-3.25.6-x64-mingw32 lib/google/protobuf/ffi/object_cache.rb
google-protobuf-3.25.6-x64-mingw-ucrt lib/google/protobuf/ffi/object_cache.rb
google-protobuf-3.25.6-arm64-darwin lib/google/protobuf/ffi/object_cache.rb
google-protobuf-3.25.6-aarch64-linux lib/google/protobuf/ffi/object_cache.rb
google-protobuf-3.25.5-java lib/google/protobuf/ffi/object_cache.rb
google-protobuf-3.25.5 lib/google/protobuf/ffi/object_cache.rb
google-protobuf-3.25.5-x86_64-linux lib/google/protobuf/ffi/object_cache.rb
google-protobuf-3.25.5-x86_64-darwin lib/google/protobuf/ffi/object_cache.rb
google-protobuf-3.25.5-x86-mingw32 lib/google/protobuf/ffi/object_cache.rb
google-protobuf-3.25.5-x86-linux lib/google/protobuf/ffi/object_cache.rb
google-protobuf-3.25.5-x64-mingw32 lib/google/protobuf/ffi/object_cache.rb
google-protobuf-3.25.5-x64-mingw-ucrt lib/google/protobuf/ffi/object_cache.rb
google-protobuf-3.25.5-arm64-darwin lib/google/protobuf/ffi/object_cache.rb
google-protobuf-3.25.5-aarch64-linux lib/google/protobuf/ffi/object_cache.rb