7#ifndef SECP256K1_SCRATCH_IMPL_H
8#define SECP256K1_SCRATCH_IMPL_H
18 memset(ret, 0,
sizeof(*ret));
19 memcpy(ret->
magic,
"scratch", 8);
20 ret->
data = (
void *) ((
char *) alloc + base_alloc);
27 if (scratch != NULL) {
33 memset(scratch->
magic, 0,
sizeof(scratch->
magic));
79 if (rounded_size < size) {
static void secp256k1_scratch_apply_checkpoint(const secp256k1_callback *error_callback, secp256k1_scratch *scratch, size_t checkpoint)
static void secp256k1_scratch_destroy(const secp256k1_callback *error_callback, secp256k1_scratch *scratch)
static void * secp256k1_scratch_alloc(const secp256k1_callback *error_callback, secp256k1_scratch *scratch, size_t size)
static size_t secp256k1_scratch_checkpoint(const secp256k1_callback *error_callback, const secp256k1_scratch *scratch)
static secp256k1_scratch * secp256k1_scratch_create(const secp256k1_callback *error_callback, size_t size)
static size_t secp256k1_scratch_max_allocation(const secp256k1_callback *error_callback, const secp256k1_scratch *scratch, size_t objects)
static SECP256K1_INLINE int secp256k1_memcmp_var(const void *s1, const void *s2, size_t n)
Semantics like memcmp.
#define ROUND_TO_ALIGN(size)
#define VERIFY_CHECK(cond)
static SECP256K1_INLINE void * checked_malloc(const secp256k1_callback *cb, size_t size)
static SECP256K1_INLINE void secp256k1_callback_call(const secp256k1_callback *const cb, const char *const text)
size_t alloc_size
amount that has been allocated (i.e.
size_t max_size
maximum size available to allocate
void * data
actual allocated data
unsigned char magic[8]
guard against interpreting this object as other types