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(
285
285
*
286
286
* Returns: a newly created scratch space.
287
287
* 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.
289
290
*/
290
291
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT secp256k1_scratch_space * secp256k1_scratch_space_create (
291
292
const secp256k1_context * ctx ,
292
- size_t max_size
293
+ size_t size
293
294
) SECP256K1_ARG_NONNULL (1 );
294
295
295
296
/** Destroy a secp256k1 scratch space.
Original file line number Diff line number Diff line change 10
10
#include "util.h"
11
11
#include "scratch.h"
12
12
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 ) {
14
14
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 );
16
16
secp256k1_scratch * ret = (secp256k1_scratch * )alloc ;
17
17
if (ret != NULL ) {
18
18
memset (ret , 0 , sizeof (* ret ));
19
19
memcpy (ret -> magic , "scratch" , 8 );
20
20
ret -> data = (void * ) ((char * ) alloc + base_alloc );
21
- ret -> max_size = max_size ;
21
+ ret -> max_size = size ;
22
22
}
23
23
return ret ;
24
24
}
You can’t perform that action at this time.
0 commit comments