Use std::vector with a custom allocator wrapping PageAllocator for wasteful_vector
Refreshed to current trunk
LGTM
Landed as r1184: http://code.google.com/p/google-breakpad/source/detail?r=1184
https://breakpad.appspot.com/581002/diff/2001/src/common/memory.h File src/common/memory.h (right): https://breakpad.appspot.com/581002/diff/2001/src/common/memory.h#newcode144 src/common/memory.h:144: allocator_(other.allocator_) {} This doesn't build on Android: FAILED: /mnt/data/b/build/goma/gomacc /mnt/data/b/build/slave/android_clang_dbg/build/src/third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/breakpad/src/client/linux/minidump_writer/breakpad_client.linux_dumper.o.d -DANGLE_DX11 -D_FILE_OFFSET_BITS=64 -DUSE_LINUX_BREAKPAD -DNO_TCMALLOC -DDISABLE_NACL -DCHROMIUM_BUILD -DCOMPONENT_BUILD -DUSE_LIBJPEG_TURBO=1 -DENABLE_WEBRTC=1 -DUSE_PROPRIETARY_CODECS -DENABLE_GPU=1 -DUSE_OPENSSL=1 -DENABLE_EGLIMAGE=1 -DENABLE_AUTOFILL_DIALOG=1 -DENABLE_LANGUAGE_DETECTION=1 -DANDROID -D__GNU_SOURCE=1 -DUSE_STLPORT=1 -D_STLP_USE_PTR_SPECIALIZATIONS=1 '-DCHROME_BUILD_ID=""' -DHAVE_SYS_UIO_H -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -D_DEBUG -I../../breakpad/src -I../../breakpad/src/client -I../../breakpad/src/third_party/linux/include -I../.. -I../../breakpad -I../../breakpad/src/common/android/include -fstack-protector --param=ssp-buffer-size=4 -Werror -fno-exceptions -fno-strict-aliasing -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -Wheader-hygiene -Wno-char-subscripts -Wno-unused-function -Wno-covered-switch-default -Wstring-conversion -Wno-unnamed-type-template-args -Wno-c++11-extensions -Xclang -load -Xclang /mnt/data/b/build/slave/android_clang_dbg/build/src/tools/clang/scripts/../../../third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so -Xclang -add-plugin -Xclang find-bad-constructs -fcolor-diagnostics -Wno-format -march=armv7-a -mtune=cortex-a8 -mfpu=vfpv3-d16 -mfloat-abi=softfp -mthumb -ffunction-sections -funwind-tables -g -fstack-protector -fno-short-enums -Wa,--noexecstack -D__compiler_offsetof=__builtin_offsetof -Dnan=__builtin_nan -target arm-linux-androideabi -mllvm -arm-enable-ehabi --sysroot=/mnt/data/b/build/slave/android_clang_dbg/build/src/third_party/android_tools/ndk//platforms/android-14/arch-arm -I/mnt/data/b/build/slave/android_clang_dbg/build/src/third_party/android_tools/ndk//sources/cxx-stl/stlport/stlport -Os -g -fomit-frame-pointer -fdata-sections -ffunction-sections -g0 -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -Wno-deprecated -Wno-abi -c ../../breakpad/src/client/linux/minidump_writer/linux_dumper.cc -o obj/breakpad/src/client/linux/minidump_writer/breakpad_client.linux_dumper.o In file included from ../../breakpad/src/client/linux/minidump_writer/linux_dumper.cc:38: In file included from ../../breakpad/src/client/linux/minidump_writer/linux_dumper.h:47: ../../breakpad/src/common/memory.h:159:26: error: 'allocator_' is a private member of 'google_breakpad::PageStdAllocator<google_breakpad::MappingInfo *>' : allocator_(other.allocator_) {} ^ /mnt/data/b/build/slave/android_clang_dbg/build/src/third_party/android_tools/ndk//sources/cxx-stl/stlport/stlport/stl/pointers/_vector.h:107:39: note: in instantiation of function template specialization 'google_breakpad::PageStdAllocator<void *>::PageStdAllocator<google_breakpad::MappingInfo *>' requested here : _M_impl(_STLP_CONVERT_ALLOCATOR(__a, _StorageType)) {} ^ /mnt/data/b/build/slave/android_clang_dbg/build/src/third_party/android_tools/ndk//sources/cxx-stl/stlport/stlport/stl/_alloc.h:183:47: note: expanded from macro '_STLP_CONVERT_ALLOCATOR' # define _STLP_CONVERT_ALLOCATOR(__a, _Tp) __a ^ ../../breakpad/src/common/memory.h:184:9: note: in instantiation of member function 'std::vector<google_breakpad::MappingInfo *, google_breakpad::PageStdAllocator<google_breakpad::MappingInfo *> >::vector' requested here : std::vector<T, PageStdAllocator<T> >(PageStdAllocator<T>(*allocator)) { ^ ../../breakpad/src/client/linux/minidump_writer/linux_dumper.cc:78:7: note: in instantiation of member function 'google_breakpad::wasteful_vector<google_breakpad::MappingInfo *>::wasteful_vector' requested here mappings_(&allocator_), ^ ../../breakpad/src/common/memory.h:174:18: note: declared private here PageAllocator& allocator_; ^ 1 error generated. ninja: build stopped: subcommand failed.