Bitcoin Core
31.1.0
P2P Digital Currency
Toggle main menu visibility
Loading...
Searching...
No Matches
src
secp256k1
include
secp256k1_preallocated.h
Go to the documentation of this file.
1
#ifndef SECP256K1_PREALLOCATED_H
2
#define SECP256K1_PREALLOCATED_H
3
4
#include "
secp256k1.h
"
5
6
#ifdef __cplusplus
7
extern
"C"
{
8
#endif
9
10
/* The module provided by this header file is intended for settings in which it
11
* is not possible or desirable to rely on dynamic memory allocation. It provides
12
* functions for creating, cloning, and destroying secp256k1 context objects in a
13
* contiguous fixed-size block of memory provided by the caller.
14
*
15
* Context objects created by functions in this module can be used like contexts
16
* objects created by functions in secp256k1.h, i.e., they can be passed to any
17
* API function that expects a context object (see secp256k1.h for details). The
18
* only exception is that context objects created by functions in this module
19
* must be destroyed using secp256k1_context_preallocated_destroy (in this
20
* module) instead of secp256k1_context_destroy (in secp256k1.h).
21
*
22
* It is guaranteed that functions in this module will not call malloc or its
23
* friends realloc, calloc, and free.
24
*/
25
35
SECP256K1_API
size_t
secp256k1_context_preallocated_size
(
36
unsigned
int
flags
37
)
SECP256K1_WARN_UNUSED_RESULT
;
38
66
SECP256K1_API
secp256k1_context
*
secp256k1_context_preallocated_create
(
67
void
*prealloc,
68
unsigned
int
flags
69
)
SECP256K1_ARG_NONNULL
(1)
SECP256K1_WARN_UNUSED_RESULT
;
70
77
SECP256K1_API
size_t
secp256k1_context_preallocated_clone_size
(
78
const
secp256k1_context
*ctx
79
)
SECP256K1_ARG_NONNULL
(1)
SECP256K1_WARN_UNUSED_RESULT
;
80
100
SECP256K1_API
secp256k1_context
*
secp256k1_context_preallocated_clone
(
101
const
secp256k1_context
*ctx,
102
void
*prealloc
103
)
SECP256K1_ARG_NONNULL
(1)
SECP256K1_ARG_NONNULL
(2)
SECP256K1_WARN_UNUSED_RESULT
;
104
126
SECP256K1_API
void
secp256k1_context_preallocated_destroy
(
127
secp256k1_context
*ctx
128
)
SECP256K1_ARG_NONNULL
(1);
129
130
#ifdef __cplusplus
131
}
132
#endif
133
134
#endif
/* SECP256K1_PREALLOCATED_H */
flags
int flags
Definition
bitcoin-tx.cpp:529
secp256k1.h
SECP256K1_ARG_NONNULL
#define SECP256K1_ARG_NONNULL(_x)
Definition
secp256k1.h:188
secp256k1_context
struct secp256k1_context_struct secp256k1_context
Unless explicitly stated all pointer arguments must not be NULL.
Definition
secp256k1.h:50
SECP256K1_API
#define SECP256K1_API
Definition
secp256k1.h:172
SECP256K1_WARN_UNUSED_RESULT
#define SECP256K1_WARN_UNUSED_RESULT
Definition
secp256k1.h:183
secp256k1_context_preallocated_clone_size
SECP256K1_API size_t secp256k1_context_preallocated_clone_size(const secp256k1_context *ctx) SECP256K1_ARG_NONNULL(1) SECP256K1_WARN_UNUSED_RESULT
Determine the memory size of a secp256k1 context object to be copied into caller-provided memory.
Definition
secp256k1.c:112
secp256k1_context_preallocated_destroy
SECP256K1_API void secp256k1_context_preallocated_destroy(secp256k1_context *ctx) SECP256K1_ARG_NONNULL(1)
Destroy a secp256k1 context object that has been created in caller-provided memory.
Definition
secp256k1.c:176
secp256k1_context_preallocated_create
SECP256K1_API secp256k1_context * secp256k1_context_preallocated_create(void *prealloc, unsigned int flags) SECP256K1_ARG_NONNULL(1) SECP256K1_WARN_UNUSED_RESULT
Create a secp256k1 context object in caller-provided memory.
Definition
secp256k1.c:118
secp256k1_context_preallocated_size
SECP256K1_API size_t secp256k1_context_preallocated_size(unsigned int flags) SECP256K1_WARN_UNUSED_RESULT
Determine the memory size of a secp256k1 context object to be created in caller-provided memory.
Definition
secp256k1.c:92
secp256k1_context_preallocated_clone
SECP256K1_API secp256k1_context * secp256k1_context_preallocated_clone(const secp256k1_context *ctx, void *prealloc) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_WARN_UNUSED_RESULT
Copy a secp256k1 context object into caller-provided memory.
Definition
secp256k1.c:152
Generated on
for Bitcoin Core by
1.17.0