scratch space: use single allocation

This commit is contained in:
Andrew Poelstra
2019-03-13 22:19:41 +00:00
parent 40839e21b9
commit 92a48a764d
2 changed files with 9 additions and 10 deletions

View File

@@ -12,12 +12,12 @@
/* The typedef is used internally; the struct name is used in the public API
* (where it is exposed as a different typedef) */
typedef struct secp256k1_scratch_space_struct {
void *data[SECP256K1_SCRATCH_MAX_FRAMES];
void *data;
void *current_frame;
size_t offset[SECP256K1_SCRATCH_MAX_FRAMES];
size_t frame_size[SECP256K1_SCRATCH_MAX_FRAMES];
size_t frame;
size_t max_size;
const secp256k1_callback* error_callback;
} secp256k1_scratch;
static secp256k1_scratch* secp256k1_scratch_create(const secp256k1_callback* error_callback, size_t max_size);