File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -285,11 +285,12 @@ SECP256K1_API void secp256k1_context_set_error_callback(
285285 *
286286 * Returns: a newly created scratch space.
287287 * Args: ctx: an existing context object (cannot be NULL)
288- * In: max_size: maximum amount of memory to allocate
288+ * In: size: amount of memory to be available as scratch space. Some extra
289+ * (<100 bytes) will be allocated for extra accounting.
289290 */
290291SECP256K1_API SECP256K1_WARN_UNUSED_RESULT secp256k1_scratch_space * secp256k1_scratch_space_create (
291292 const secp256k1_context * ctx ,
292- size_t max_size
293+ size_t size
293294) SECP256K1_ARG_NONNULL (1 );
294295
295296/** Destroy a secp256k1 scratch space.
Original file line number Diff line number Diff line change 1010#include "util.h"
1111#include "scratch.h"
1212
13- static secp256k1_scratch * secp256k1_scratch_create (const secp256k1_callback * error_callback , size_t max_size ) {
13+ static secp256k1_scratch * secp256k1_scratch_create (const secp256k1_callback * error_callback , size_t size ) {
1414 const size_t base_alloc = ((sizeof (secp256k1_scratch ) + ALIGNMENT - 1 ) / ALIGNMENT ) * ALIGNMENT ;
15- void * alloc = checked_malloc (error_callback , base_alloc + max_size );
15+ void * alloc = checked_malloc (error_callback , base_alloc + size );
1616 secp256k1_scratch * ret = (secp256k1_scratch * )alloc ;
1717 if (ret != NULL ) {
1818 memset (ret , 0 , sizeof (* ret ));
1919 memcpy (ret -> magic , "scratch" , 8 );
2020 ret -> data = (void * ) ((char * ) alloc + base_alloc );
21- ret -> max_size = max_size ;
21+ ret -> max_size = size ;
2222 }
2323 return ret ;
2424}
You can’t perform that action at this time.
0 commit comments