Skip to content

Conversation

@maflcko
Copy link
Member

@maflcko maflcko commented Jun 27, 2019

The rationale for caching the datadir is given as

    // This can be called during exceptions by LogPrintf(), so we cache the
    // value so we don't have to do memory allocations after that.

Since 8c2d695, the debug log location is actually cached itself in m_file_path.

So explain that the caching is now only used to guard against disk access on each call. (See also #16255)

@maflcko maflcko force-pushed the 1906-utilPathWhy branch from fad675c to fa69c3e Compare June 27, 2019 18:42
Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK fa69c3e. Good cleanup. Previous comment was confusing, and definitely not helpful if outdated.

@DrahtBot
Copy link
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #16273 (refactor: Remove unused includes by practicalswift)
  • #15934 (Separate settings merging from parsing by ryanofsky)
  • #15864 (Fix datadir handling by hebasto)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@promag
Copy link
Contributor

promag commented Jun 28, 2019

ACK fa69c3e.

@laanwj
Copy link
Member

laanwj commented Jun 28, 2019

Fair enough, I liked the ambitiousness of getting rid of this code, but, this is a clear and non-controversial improvement
ACK fa69c3e

@laanwj laanwj merged commit fa69c3e into bitcoin:master Jun 28, 2019
laanwj added a commit that referenced this pull request Jun 28, 2019
fa69c3e util: Explain why the path is cached (MarcoFalke)

Pull request description:

  The rationale for caching the datadir is given as

  ```
      // This can be called during exceptions by LogPrintf(), so we cache the
      // value so we don't have to do memory allocations after that.
  ```

  Since 8c2d695, the debug log location is actually cached itself in `m_file_path`.

  So explain that the caching is now only used to guard against disk access on each call. (See also #16255)

ACKs for top commit:
  promag:
    ACK fa69c3e.
  laanwj:
    ACK fa69c3e
  ryanofsky:
    utACK fa69c3e. Good cleanup. Previous comment was confusing, and definitely not helpful if outdated.

Tree-SHA512: 02108c90026d6d7c02843aaf59a06b4e1fa63d5d4378bb7760f50767efc340dc94c259bf7afb32fa4d47952b48a4e91798d1e0ddc1b051d770405e078636793a
@maflcko maflcko deleted the 1906-utilPathWhy branch June 28, 2019 12:41
@hebasto hebasto mentioned this pull request Jun 28, 2019
deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Apr 20, 2020
Summary: This is a backport of Core [[bitcoin/bitcoin#16300 | PR16300]]

Test Plan:
  make check

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D5774
ftrader pushed a commit to bitcoin-cash-node/bitcoin-cash-node that referenced this pull request Aug 17, 2020
Summary: This is a backport of Core [[bitcoin/bitcoin#16300 | PR16300]]

Test Plan:
  make check

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D5774
Munkybooty pushed a commit to Munkybooty/dash that referenced this pull request Nov 18, 2021
fa69c3e util: Explain why the path is cached (MarcoFalke)

Pull request description:

  The rationale for caching the datadir is given as

  ```
      // This can be called during exceptions by LogPrintf(), so we cache the
      // value so we don't have to do memory allocations after that.
  ```

  Since 8c2d695, the debug log location is actually cached itself in `m_file_path`.

  So explain that the caching is now only used to guard against disk access on each call. (See also bitcoin#16255)

ACKs for top commit:
  promag:
    ACK fa69c3e.
  laanwj:
    ACK fa69c3e
  ryanofsky:
    utACK fa69c3e. Good cleanup. Previous comment was confusing, and definitely not helpful if outdated.

Tree-SHA512: 02108c90026d6d7c02843aaf59a06b4e1fa63d5d4378bb7760f50767efc340dc94c259bf7afb32fa4d47952b48a4e91798d1e0ddc1b051d770405e078636793a
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants