Switch to a single malloc call

This commit is contained in:
Tim Ruffing committed 2019-05-25 14:01:09 +02:00
1 parent ef020de16f
commit c4fd5dab45
8 files changed
+79 -66

No files matched your search

+6
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)