Sha256: 69a08706e41deabcccd856058ce0aa23a350fa384dee136ee05884f0cf97d497

Contents?: true

Size: 844 Bytes

Versions: 281

Compression:

Stored size: 844 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::Internal::ObjectCache
      else
        Google::Protobuf::Internal::LegacyObjectCache
      end
    end

    public
    OBJECT_CACHE = cache_implementation.new
  end
end

Version data entries

281 entries across 281 versions & 2 rubygems

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