Sha256: b3281d00f3a4b3f5a240e82679e69103c459c318e02cd0e3ee9caca1b9c90285

Contents?: true

Size: 631 Bytes

Versions: 24

Compression:

Stored size: 631 Bytes

Contents

# see https://github.com/chuckremes/ffi-rzmq/pull/133

require 'ffi-rzmq'
require 'ffi-rzmq/message'

module ZMQ
  class Message
    def copy_in_bytes bytes, len
      data_buffer = LibC.malloc len
      # writes the exact number of bytes, no null byte to terminate string
      data_buffer.put_bytes 0, bytes, 0, len

      # use libC to call free on the data buffer; earlier versions used an
      # FFI::Function here that called back into Ruby, but Rubinius won't
      # support that and there are issues with the other runtimes too
      LibZMQ.zmq_msg_init_data @pointer, data_buffer, len, LibC::Free, nil
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
logjam_agent-0.39.1 lib/logjam_agent/monkey_patches/ffi-rzmq-patch.rb
logjam_agent-0.39.0 lib/logjam_agent/monkey_patches/ffi-rzmq-patch.rb
logjam_agent-0.38.5 lib/logjam_agent/monkey_patches/ffi-rzmq-patch.rb
logjam_agent-0.38.4 lib/logjam_agent/monkey_patches/ffi-rzmq-patch.rb
logjam_agent-0.38.3 lib/logjam_agent/monkey_patches/ffi-rzmq-patch.rb
logjam_agent-0.38.2 lib/logjam_agent/monkey_patches/ffi-rzmq-patch.rb
logjam_agent-0.38.1 lib/logjam_agent/monkey_patches/ffi-rzmq-patch.rb
logjam_agent-0.38.0 lib/logjam_agent/monkey_patches/ffi-rzmq-patch.rb
logjam_agent-0.37.1 lib/logjam_agent/monkey_patches/ffi-rzmq-patch.rb
logjam_agent-0.37.0 lib/logjam_agent/monkey_patches/ffi-rzmq-patch.rb
logjam_agent-0.36.0 lib/logjam_agent/monkey_patches/ffi-rzmq-patch.rb
logjam_agent-0.35.1 lib/logjam_agent/monkey_patches/ffi-rzmq-patch.rb
logjam_agent-0.35.0 lib/logjam_agent/monkey_patches/ffi-rzmq-patch.rb
logjam_agent-0.34.3 lib/logjam_agent/monkey_patches/ffi-rzmq-patch.rb
logjam_agent-0.34.2 lib/logjam_agent/monkey_patches/ffi-rzmq-patch.rb
logjam_agent-0.34.1 lib/logjam_agent/monkey_patches/ffi-rzmq-patch.rb
logjam_agent-0.34.0 lib/logjam_agent/monkey_patches/ffi-rzmq-patch.rb
logjam_agent-0.33.3 lib/logjam_agent/monkey_patches/ffi-rzmq-patch.rb
logjam_agent-0.33.2 lib/logjam_agent/monkey_patches/ffi-rzmq-patch.rb
logjam_agent-0.33.1 lib/logjam_agent/monkey_patches/ffi-rzmq-patch.rb