-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpimalloc.h
More file actions
72 lines (52 loc) · 1.37 KB
/
pimalloc.h
File metadata and controls
72 lines (52 loc) · 1.37 KB
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
/*
*
* pimalloc.h
*
* Author: Markku Rossi <[email protected]>
*
* Copyright (c) 2003-2007 Markku Rossi.
*
* See the LICENSE file for the details on licensing.
*
* Memory allocation functions.
*
*/
#ifndef PIMALLOC_H
#define PIMALLOC_H
/* Allocate `size' bytes of memory. The function returns a pointer to
the beginning of the allocated memory block or NULL if the system
ran out of memory. */
void *pi_malloc(size_t size);
/* XXX */
void *pi_calloc(size_t number, size_t size);
/* XXX */
void *pi_realloc(void *ptr, size_t old_size, size_t new_size);
/* XXX */
void pi_free(void *ptr);
/* XXX */
char *pi_strdup(const char *str);
/* XXX */
unsigned char *pi_memdup(const unsigned char *data, size_t len);
/* Tag block `ptr' with the tag `tag'. The maximum length of the tag
is 7 characters. */
void pi_malloc_tag_block(void *ptr, const char *tag);
/* XXX */
void *pi_xmalloc(size_t size);
/* XXX */
void *pi_xcalloc(size_t number, size_t size);
/* XXX */
void *pi_xrealloc(void *ptr, size_t old_size, size_t new_size);
/* XXX */
void pi_xfree(void *ptr);
/* XXX */
char *pi_xstrdup(const char *str);
/* XXX */
unsigned char *pi_xmemdup(const unsigned char *data, size_t len);
#ifdef ENABLE_DEBUG
/* Memory leak debugging. */
/* XXX */
void pi_malloc_dump_blocks(void);
/* XXX */
void pi_malloc_dump_statistics(void);
#endif /* ENABLE_DEBUG */
#endif /* PIMALLOC_H */