HomePhabricator

scratch space: use single allocation

Description

scratch space: use single allocation

Summary:

  • scratch: add magic bytes to beginning of structure
  • scratch space: thread error_callback into all scratch space functions

Use it when checking magic bytes

  • scratch: unify allocations
  • scratch: rename max_size to size, document that extra will actually be allocated
  • scratch: save a couple bytes of unnecessarily-allocated memory
  • scratch: replace frames with "checkpoint" system

This is a backport of secp256k1 PR600

Test Plan:

ninja check-secp256k1

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D5146

Details

Provenance
Andrew Poelstra <apoelstra@wpsoftware.net>Authored on Mar 13 2019, 22:19
deadalnixCommitted on Feb 5 2020, 16:35
deadalnixPushed on Feb 5 2020, 17:40
Reviewer
Restricted Project
Differential Revision
D5146: scratch space: use single allocation
Parents
rSTAGING6564b850d4b3: add sigchecks limiter to CheckInputs
Branches
Unknown
Tags
Unknown
References
tag: phabricator/base/16036, tag: phabricator/base/16035