]> git.ipfire.org Git - thirdparty/squid.git/commit - src/ipc/Queue.cc
Reverted trunk r12255 changes. Provided a portable flexible arrays replacement.
authorAlex Rousskov <rousskov@measurement-factory.com>
Tue, 16 Oct 2012 00:26:06 +0000 (18:26 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Tue, 16 Oct 2012 00:26:06 +0000 (18:26 -0600)
commit3a8c55517a7207c87a094942d9aa389d7f0a9b89
tree9769c9430497cbedcf3b4b4a071cc689e2d1eb45
parent54347cbdf50fe061d185e02da76a36fad2a3a48a
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