VirtualBox

source: vbox/trunk/src/libs/libtpms-0.9.6/man/man3/TPM_Malloc.pod

Last change on this file was 91612, checked in by vboxsync, 4 years ago

src/libs: Export libtpms-0.9.0, bugref:10078

File size: 1.8 KB
Line 
1=head1 NAME
2
3TPM_Malloc - Allocate memory
4
5TPM_Realloc - Reallocate memory
6
7TPM_Free - Free memory
8
9=head1 SYNOPSIS
10
11B<#include <libtpms/tpm_types.h>>
12
13B<#include <libtpms/tpm_memory.h>>
14
15B<#include <libtpms/tpm_error.h>>
16
17B<TPM_RESULT TPM_Malloc(unsigned char> **I<buffer>B<,
18 uint32_t> I<size>B<);>
19
20B<TPM_RESULT TPM_Realloc(unsigned char> **I<buffer>B<,
21 uint32_t> I<size>B<);>
22
23B<void TPM_Free(unsigned char> *I<buffer>B<);>
24
25=head1 DESCRIPTION
26
27The B<TPM_Malloc()> function is used to allocate a buffer of the given size.
28The allocated buffer will be returned in the I<buffer> parameter.
29
30The B<TPM_Realloc()> function is used to resize a buffer. The new size of
31the buffer is given in the I<size> parameter. The reallocated buffer will
32contain the data from the original buffer.
33
34Both functions have the restriction that the buffer they can allocate
35is limited to B<TPM_ALLOC_MAX> (64k) bytes. This size is sufficient
36for all buffers needed by the TPM.
37
38Upon successful completion, the functions return B<TPM_SUCCESS>. In case the
39requested buffer exceeds the limit, B<TPM_SIZE> will be returned. See further
40possible error codes below.
41
42The B<TPM_Free()> function frees the memory previously allocated using
43either B<TPM_Malloc()> or B<TPM_Realloc()>.
44
45=head1 ERRORS
46
47=over 4
48
49=item B<TPM_SUCCESS>
50
51The function completed successfully.
52
53=item B<TPM_SIZE>
54
55The size of the requested buffer exceeds the limit or the
56system is out of memory.
57
58=item B<TPM_FAIL>
59
60Requested buffer is of size 0.
61
62=back
63
64For a complete list of TPM error codes please consult the include file
65B<libtpms/tpm_error.h>
66
67=head1 SEE ALSO
68
69B<TPMLIB_MainInit>(3), B<TPMLIB_Terminate>(3)
70B<TPMLIB_Process>(3), B<TPMLIB_RegisterCallbacks>(3), B<TPMLIB_GetVersion>(3)
71
72=cut
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette