]> git.ipfire.org Git - thirdparty/squid.git/commit
Reverted trunk r12255 changes. Provided a portable flexible arrays replacement.
authorAlex Rousskov <rousskov@measurement-factory.com>
Tue, 16 Oct 2012 23:46:07 +0000 (17:46 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 16 Oct 2012 23:46:07 +0000 (17:46 -0600)
commitca95a4cc7d27f065db6b2633a9c69f9c1c99a6d5
tree4060bc71d22e3c902838db88243233c764a0b014
parentc5fe880efd43deeb8afc72da66bd83a16294b52b
Reverted trunk r12255 changes. Provided a portable flexible arrays replacement.

Trunk r12255 made Clang compiler happy by removing flexible nonPod[] arrays.
Unfortunately, it also moved shared memory items into local memory (in some
cases uninitialized).

This change provides a Clang-friendly flexible array replacement while keeping
items in the shared memory (and using placement-new initialization). The code
may have become even less readable, but hopefully more portable.

N.B. Flexible arrays were introdiced in C99 standard, after C++ was
standardized in 1998. They are not yet in any revised C++ standard, but most
C++ compilers support them, at least for PODs.
src/ipc/Makefile.am
src/ipc/Queue.cc
src/ipc/Queue.h
src/ipc/StoreMap.cc
src/ipc/StoreMap.h
src/ipc/mem/FlexibleArray.h [new file with mode: 0644]
src/ipc/mem/PageStack.cc
src/ipc/mem/PageStack.h