Commit 5edd05b5 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Register with AtFork without an object in BufferedRandomDevice

Summary: [Folly] Register with `AtFork` without an object in `BufferedRandomDevice`, since no object is actually needed and since it is possible for the object passed in to be destroyed.

Reviewed By: luciang

Differential Revision: D19207385

fbshipit-source-id: 7c0e2793d9b438e576bf26bc3b3b459b372aec6d
parent c8e0eca1
...@@ -115,9 +115,9 @@ BufferedRandomDevice::BufferedRandomDevice(size_t bufferSize) ...@@ -115,9 +115,9 @@ BufferedRandomDevice::BufferedRandomDevice(size_t bufferSize)
: bufferSize_(bufferSize), : bufferSize_(bufferSize),
buffer_(new unsigned char[bufferSize]), buffer_(new unsigned char[bufferSize]),
ptr_(buffer_.get() + bufferSize) { // refill on first use ptr_(buffer_.get() + bufferSize) { // refill on first use
call_once(flag, [this]() { call_once(flag, [] {
detail::AtFork::registerHandler( detail::AtFork::registerHandler(
this, nullptr,
/*prepare*/ []() { return true; }, /*prepare*/ []() { return true; },
/*parent*/ []() {}, /*parent*/ []() {},
/*child*/ /*child*/
......
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