1. 14 Jun, 2015 2 commits
    • Jens Auer's avatar
      Fixed wrong handling of shared messages · 51cb57e2
      Jens Auer authored
      The shared reference count was not shared but copied. msg_t cannot
      store the refcnt itsef but has to store a pointer to an externally
      allocated (shared) refcnter. The changes to lmsg are reverted to
      use content_t again. Howver, this introduces an allocation in v2_decoder
      when creating the message which can be avoided. When allocating the reception
      buffer, space is allocated for the maximum number of reference counts
      (8192 / max_vsm_size = 8192/64 = 128 zmq:atomic_counter objects). This
      increases the buffer by 128*sizeof(atomic_counter) = 128*4 = 512 bytes only.
      When creating a message, the refcnt member is set to the address of one of the
      pre-allocated atomic_counter_t objects. To do so, a new msg_t type zcmsg
      is introduced because msg::copy must discriminate between the message types
      when releasing memory.
      51cb57e2
    • Jens Auer's avatar
      Fixed wrong buffer end detection in v2_decoder. · dfe19080
      Jens Auer authored
      zero-copy msg_t::init cannot be used when the message exceeds either
      the buffer end or the last received byte. To detect this, the buffer
      is now resized to the numnber of received bytes.
      dfe19080
  2. 13 Jun, 2015 2 commits
  3. 11 Jun, 2015 2 commits
  4. 10 Jun, 2015 3 commits
  5. 08 Jun, 2015 2 commits
  6. 07 Jun, 2015 5 commits
  7. 06 Jun, 2015 2 commits
  8. 05 Jun, 2015 13 commits
  9. 04 Jun, 2015 4 commits
  10. 03 Jun, 2015 4 commits
    • Kapp Arnaud's avatar
      Introduce a failing test against zmq_setsockpt(). · fb960147
      Kapp Arnaud authored
      Problem: zmq_setsockpt() returns success when changing the
      HWM after a bind or connect() even though the call has no effect.
      
      Solution: Introduce a failing test a reminder we need to patch it.
      fb960147
    • Pieter Hintjens's avatar
      Merge pull request #1417 from jens-auer/zero_copy · 9e80f07a
      Pieter Hintjens authored
      Zero copy message receive in v2_decoder
      9e80f07a
    • Jens Auer's avatar
      zero-copy message receive · e9b403a7
      Jens Auer authored
      Construct messages from a reference-counted buffer allocated once
      per receive instead of copying the data.
      e9b403a7
    • Jens Auer's avatar
      Allocation-free msg::init_data · 611e96c7
      Jens Auer authored
      With a msg_t size of 64 bytes, it becomes possible to embedd the content_t's members
      struct for large messages directly in the msg_t. This saves the dynamic allocation
      of content_t obejcts when using msg_t::init_data.
      
      content_t contains a zmq::atomic_counter_t object which is not a POD in C++98
      and thus it cannot be used as a member of the union u. To bypass this, C++11
      is used which has relaxed rules for POD and atomic_counter is a C++11-POD. An
      alternative would have been to make atomic_counter a classical POD by removing
      constructors and all private member functions, i.e. have a struct and free functions
      to manipulate it.
      
      A new msg_t::init function is added which decides to either to copy the data for size<64 bytes
      or use msg_t::init_data to do zero-copy initialization.
      611e96c7
  11. 02 Jun, 2015 1 commit