Commit 8b650246 authored by Robin Cheng's avatar Robin Cheng Committed by Facebook GitHub Bot

Fix an issue in ElfCache that makes it async-signal-unsafe.

Summary:
basic_fbstring unfortunately just ignores the allocator. Switching it to use std::basic_string.

This is necessary because ElfCache must be async-signal-safe, but basic_fbstring ignores the allocator and always uses standard malloc/free, which are not safe async-signal-safe.

Reviewed By: yfeldblum

Differential Revision: D23035304

fbshipit-source-id: 7b4e77a3764701366556a5fe5a352f952b052ed4
parent 4506ae37
......@@ -24,7 +24,6 @@
#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>
......@@ -48,8 +47,8 @@ class SignalSafeElfCache : public ElfCacheBase {
public:
std::shared_ptr<ElfFile> getFile(StringPiece path) override;
using Path =
basic_fbstring<char, std::char_traits<char>, reentrant_allocator<char>>;
using Path = std::
basic_string<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