Electroneum
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 
36  unsigned int flags
38 
67  void* prealloc,
68  unsigned int flags
70 
78  const secp256k1_context* ctx
80 
98  const secp256k1_context* ctx,
99  void* prealloc
101 
123  secp256k1_context* ctx
125 
126 #ifdef __cplusplus
127 }
128 #endif
129 
130 #endif /* SECP256K1_PREALLOCATED_H */
SECP256K1_API secp256k1_context * secp256k1_context_preallocated_create(void *prealloc, unsigned int flags) SECP256K1_ARG_NONNULL(1) SECP256K1_WARN_UNUSED_RESULT
#define SECP256K1_WARN_UNUSED_RESULT
Definition: secp256k1.h:172
SECP256K1_API size_t secp256k1_context_preallocated_size(unsigned int flags) SECP256K1_WARN_UNUSED_RESULT
SECP256K1_API void secp256k1_context_preallocated_destroy(secp256k1_context *ctx) SECP256K1_ARG_NONNULL(1)
struct secp256k1_context_struct secp256k1_context
Definition: secp256k1.h:50
#define SECP256K1_ARG_NONNULL(_x)
Definition: secp256k1.h:177
SECP256K1_API size_t secp256k1_context_preallocated_clone_size(const secp256k1_context *ctx) SECP256K1_ARG_NONNULL(1) SECP256K1_WARN_UNUSED_RESULT
#define SECP256K1_API
Definition: secp256k1.h:162
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