[#ASYNC_set_mem_functions]
= ASYNC&lowbar;set&lowbar;mem&lowbar;functions
:mrdocs:

Install custom stack allocators used for ASYNC jobs on POSIX&period;

== Synopsis

Declared in `&lt;openssl&sol;async&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
ASYNC&lowbar;set&lowbar;mem&lowbar;functions(
    xref:ASYNC_stack_alloc_fn.adoc[ASYNC&lowbar;stack&lowbar;alloc&lowbar;fn] alloc&lowbar;fn,
    xref:ASYNC_stack_free_fn.adoc[ASYNC&lowbar;stack&lowbar;free&lowbar;fn] free&lowbar;fn);
----

== Description

Must be called before any asynchronous job allocates a stack&period; On unsupported platforms the call fails and the defaults remain in effect&period;

== Return Value

1 if custom allocators are supported and none have been used yet, or 0 otherwise&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *alloc&lowbar;fn*
| Allocator called when OpenSSL needs a job stack, or NULL for the default&period;
| *free&lowbar;fn*
| Matching free callback for stacks returned by `alloc&lowbar;fn,` or NULL for the default&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
