Commit abb4ece6 authored by Chad Austin's avatar Chad Austin Committed by Facebook GitHub Bot

Avoid std::string with reentrant_allocator in ElfCache

Summary:
The implementation of `std::basic_string` with the legacy ABI and with `_GLIBCXX_FULLY_DYNAMIC_STRING`, as appears by default on CentOS 7, incorrectly requires the provided allocator type to have a default constructor. The `Allocator` concept does not require this and many allocator types with runtime state shared between copies will not provide this.

Switch to `folly::fbstring` in `ElfCache` to sidestep this problem.

Fixes: https://github.com/facebook/folly/issues/1344.

Reviewed By: yfeldblum

Differential Revision: D22970418

fbshipit-source-id: 1e188d668991d25f53da5702b31f4a7a7ec7d7e8
parent b19f4306
......@@ -24,6 +24,7 @@
#include <boost/intrusive/avl_set.hpp>
#include <folly/FBString.h>
#include <folly/Range.h>
#include <folly/experimental/symbolizer/Elf.h>
#include <folly/hash/Hash.h>
......@@ -47,10 +48,8 @@ class SignalSafeElfCache : public ElfCacheBase {
public:
std::shared_ptr<ElfFile> getFile(StringPiece path) override;
using Path = std::basic_string< //
char,
std::char_traits<char>,
reentrant_allocator<char>>;
using Path =
basic_fbstring<char, std::char_traits<char>, reentrant_allocator<char>>;
struct Entry : boost::intrusive::avl_set_base_hook<> {
Path path;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment