MarcoFalke
commented at 7:21 am on April 30, 2022:
member
Currently a pointer is passed, which is confusing and requires run-time asserts to avoid nullptr dereference.
All call sites can pass a reference, so do that. Also mark it LIFETIMEBOUND to avoid call sites passing a temporary. Also, unrelated cleanup in touched lines.
Pass lifetimebound reference to SingleThreadedSchedulerClientfa4652ce59
MarcoFalke added the label
Refactoring
on Apr 30, 2022
jonatack
commented at 4:05 pm on May 3, 2022:
member
Code review ACKfa4652ce5995ace831b6a4d3125bfcac9563ff6f rebased to master, debug build, unit tests
This commit:
passes the SingleThreadedSchedulerClient::scheduler param by reference instead of a pointer, which allows dropping a runtime non-nullptr assertion in SingleThreadedSchedulerClient::AddToProcessQueue() to avoid nullptr dereferencing (similar change in recently-merged #25016)
adds the clang LIFETIMEBOUND attribute to the SingleThreadedSchedulerClient and MainSignalsInstance constructors to avoid call sites passing a temporary
renames m_pscheduler to m_scheduler
adds missing header includes to scheduler.h
replaces a less-efficient std::bind with a lambda
replaces a reset(new) with preferred std::make_unique
The lifetimebound attribute indicates that a resource owned by a function parameter or implicit object parameter is retained by the return value of the annotated function (or, for a parameter of a constructor, in the value of the constructed object).
This is a metadata mirror of the GitHub repository
bitcoin/bitcoin.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2024-12-04 06:12 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me