Switch to a single malloc call

This commit is contained in:
Tim Ruffing
2018-10-22 16:25:26 +02:00
parent ef020de16f
commit c4fd5dab45
8 changed files with 79 additions and 66 deletions

View File

@@ -187,6 +187,9 @@ typedef int (*secp256k1_nonce_function)(
SECP256K1_API extern const secp256k1_context *secp256k1_context_no_precomp;
/** Create a secp256k1 context object.
*
* This function uses malloc to allocate memory. It is guaranteed that malloc is
* called at most once for every call of this function.
*
* Returns: a newly created context object.
* In: flags: which parts of the context to initialize.
@@ -198,6 +201,9 @@ SECP256K1_API secp256k1_context* secp256k1_context_create(
) SECP256K1_WARN_UNUSED_RESULT;
/** Copies a secp256k1 context object.
*
* This function uses malloc to allocate memory. It is guaranteed that malloc is
* called at most once for every call of this function.
*
* Returns: a newly created context object.
* Args: ctx: an existing context to copy (cannot be NULL)