summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>2022-02-24 13:13:25 -0500
committerMatt Caswell <matt@openssl.org>2022-03-10 13:54:07 +0000
commitf6f56f4776727e18d4dd5490e3b507bae068013a (patch)
treecf3781579d62905f2e4198f2595204ba4b22892c /doc
parent83c48d96ff24728d94e0890f320b0d1220d9cba3 (diff)
async_posix: Allow custom stack allocation functions to be specified for POSIX contexts
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17762)
Diffstat (limited to 'doc')
-rw-r--r--doc/man3/ASYNC_start_job.pod22
1 files changed, 21 insertions, 1 deletions
diff --git a/doc/man3/ASYNC_start_job.pod b/doc/man3/ASYNC_start_job.pod
index b2e7a583d4..9cf34f65ce 100644
--- a/doc/man3/ASYNC_start_job.pod
+++ b/doc/man3/ASYNC_start_job.pod
@@ -4,7 +4,8 @@
ASYNC_get_wait_ctx,
ASYNC_init_thread, ASYNC_cleanup_thread, ASYNC_start_job, ASYNC_pause_job,
-ASYNC_get_current_job, ASYNC_block_pause, ASYNC_unblock_pause, ASYNC_is_capable
+ASYNC_get_current_job, ASYNC_block_pause, ASYNC_unblock_pause, ASYNC_is_capable,
+ASYNC_stack_alloc_fn, ASYNC_stack_free_fn, ASYNC_set_mem_functions, ASYNC_get_mem_functions
- asynchronous job management functions
=head1 SYNOPSIS
@@ -25,6 +26,13 @@ ASYNC_get_current_job, ASYNC_block_pause, ASYNC_unblock_pause, ASYNC_is_capable
int ASYNC_is_capable(void);
+ typedef void *(*ASYNC_stack_alloc_fn)(size_t *num);
+ typedef void (*ASYNC_stack_free_fn)(void *addr);
+ int ASYNC_set_mem_functions(ASYNC_stack_alloc_fn alloc_fn,
+ ASYNC_stack_free_fn free_fn);
+ void ASYNC_get_mem_functions(ASYNC_stack_alloc_fn *alloc_fn,
+ ASYNC_stack_free_fn *free_fn);
+
=head1 DESCRIPTION
OpenSSL implements asynchronous capabilities through an B<ASYNC_JOB>. This
@@ -146,6 +154,15 @@ occur.
Some platforms cannot support async operations. The ASYNC_is_capable() function
can be used to detect whether the current platform is async capable or not.
+Custom memory allocation functions are supported for the POSIX platform.
+Custom memory allocation functions allow alternative methods of allocating
+stack memory such as mmap, or using stack memory from the current thread.
+Using an ASYNC_stack_alloc_fn callback also allows manipulation of the stack
+size, which defaults to 32k.
+The stack size can be altered by allocating a stack of a size different to
+the requested size, and passing back the new stack size in the callback's I<*num>
+parameter.
+
=head1 RETURN VALUES
ASYNC_init_thread returns 1 on success or 0 otherwise.
@@ -165,6 +182,9 @@ ASYNC_get_wait_ctx() returns a pointer to the B<ASYNC_WAIT_CTX> for the job.
ASYNC_is_capable() returns 1 if the current platform is async capable or 0
otherwise.
+ASYNC_set_mem_functions returns 1 if custom stack allocators are supported by
+the current platform and no allocations have already occurred or 0 otherwise.
+
=head1 NOTES
On Windows platforms the F<< <openssl/async.h> >> header is dependent on some