]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/libxo/libxo/xo_set_allocator.3
Merge clang trunk r366426, resolve conflicts, and update FREEBSD-Xlist.
[FreeBSD/FreeBSD.git] / contrib / libxo / libxo / xo_set_allocator.3
1 .\" #
2 .\" # Copyright (c) 2014, Juniper Networks, Inc.
3 .\" # All rights reserved.
4 .\" # This SOFTWARE is licensed under the LICENSE provided in the
5 .\" # ../Copyright file. By downloading, installing, copying, or 
6 .\" # using the SOFTWARE, you agree to be bound by the terms of that
7 .\" # LICENSE.
8 .\" # Phil Shafer, July 2014
9 .\" 
10 .Dd December 4, 2014
11 .Dt LIBXO 3
12 .Os
13 .Sh NAME
14 .Nm xo_set_allocator
15 .Nd set allocation functions for libxo
16 .Sh LIBRARY
17 .Lb libxo
18 .Sh SYNOPSIS
19 .In libxo/xo.h
20 .Sy typedef void *(*xo_realloc_func_t)(void *, size_t);
21 .Pp
22 .Sy typedef void (*xo_free_func_t)(void *);
23 .Ft void
24 .Fn xo_set_allocator "xo_realloc_func_t realloc_func" "xo_free_func_t free_func"
25 .Sh DESCRIPTION
26 The
27 .Fn xo_set_allocator
28 function allows
29 .Nm libxo
30 to be used in environments
31 where the standard
32 .Xr realloc 3
33 and
34 .Xr free 3
35 functions are not available.
36 .Pp
37 .Fa realloc_func
38 should expect the same arguments as
39 .Xr realloc 3
40 and return
41 a pointer to memory following the same convention.
42 .Fa free_func
43 will receive the same argument as
44 .Xr free 3
45 and should release it, as appropriate for the environment.
46 .Pp
47 By default, the standard
48 .Xr realloc 3
49 and
50 .Xr free 3
51 functions are used.
52 .Sh SEE ALSO
53 .Xr xo_emit 3 ,
54 .Xr libxo 3
55 .Sh HISTORY
56 The
57 .Nm libxo
58 library first appeared in
59 .Fx 11.0 .
60 .Sh AUTHORS
61 .Nm libxo
62 was written by
63 .An Phil Shafer Aq Mt phil@freebsd.org .
64