1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
* Copyright (C) the libgit2 contributors. All rights reserved.
*
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
/**
* @file git2/sys/alloc.h
* @brief Custom memory allocators
* @defgroup git_merge Git merge routines
* @ingroup Git
*
* Users can configure custom allocators; this is particularly
* interesting when running in constrained environments, when calling
* from another language, or during testing.
* @{
*/
/**
* An instance for a custom memory allocator
*
* Setting the pointers of this structure allows the developer to implement
* custom memory allocators. The global memory allocator can be set by using
* "GIT_OPT_SET_ALLOCATOR" with the `git_libgit2_opts` function. Keep in mind
* that all fields need to be set to a proper function.
*/
typedef struct git_allocator;
/**
* Initialize the allocator structure to use the `stdalloc` pointer.
*
* Set up the structure so that all of its members are using the standard
* "stdalloc" allocator functions. The structure can then be used with
* `git_allocator_setup`.
*
* @param allocator The allocator that is to be initialized.
* @return An error code or 0.
*/
int ;
/**
* Initialize the allocator structure to use the `crtdbg` pointer.
*
* Set up the structure so that all of its members are using the "crtdbg"
* allocator functions. Note that this allocator is only available on Windows
* platforms and only if libgit2 is being compiled with "-DMSVC_CRTDBG".
*
* @param allocator The allocator that is to be initialized.
* @return An error code or 0.
*/
int ;
/** @} */