• 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
Name
Last commit
Last update
builds Loading commit data...
doc Loading commit data...
include Loading commit data...
packaging/nuget Loading commit data...
perf Loading commit data...
src Loading commit data...
tests Loading commit data...
tools Loading commit data...
tweetnacl Loading commit data...
.gitignore Loading commit data...
.hgeol Loading commit data...
.travis.yml Loading commit data...
AUTHORS Loading commit data...
CMakeLists.txt Loading commit data...
COPYING Loading commit data...
COPYING.LESSER Loading commit data...
Dockerfile Loading commit data...
INSTALL Loading commit data...
MAINTAINERS Loading commit data...
Makefile.am Loading commit data...
NEWS Loading commit data...
README.cygwin.md Loading commit data...
README.md Loading commit data...
acinclude.m4 Loading commit data...
autogen.sh Loading commit data...
branding.bmp Loading commit data...
ci_build.sh Loading commit data...
configure.ac Loading commit data...
installer.ico Loading commit data...
version.sh Loading commit data...