HomePhabricator

Enable context creation in preallocated memory

Description

Enable context creation in preallocated memory

Summary:

  • Prepare for manual memory management in preallocated memory
    • Determine ALIGNMENT more cleverly and move it to util.h
    • Implement manual_malloc() helper function
  • Add size constants for preallocated memory
  • Switch to a single malloc call
  • Support cloning a context into preallocated memory
  • Check arguments of _preallocated functions
  • Add tests for contexts in preallocated memory
  • Export _preallocated functions
  • Move _preallocated functions to separate header
  • Explain caller's obligations for preallocated memory

This is a backport of secp256k1 PR566

Depends on D5030

Test Plan:

ninja check-secp256k1

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

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

Details

Provenance
Tim Ruffing <crypto@timruffing.de>Authored on Oct 18 2018, 17:09
deadalnixCommitted on Jan 22 2020, 15:25
deadalnixPushed on Jan 22 2020, 15:25
Reviewer
Restricted Project
Differential Revision
D5031: Enable context creation in preallocated memory
Parents
rABCc95a014ae7f7: Make WINDOW_G configurable
Branches
Unknown
Tags
Unknown