summaryrefslogtreecommitdiff
path: root/src/xmalloc.h
blob: cf357125b528de9618afbfef063b760d763ba445 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef XMALLOC_H
#define XMALLOC_H

#include <stdlib.h>

[[nodiscard("memory leaked")]]
[[gnu::malloc]]
void *xmalloc(size_t size);

[[nodiscard("memory leaked")]]
[[gnu::malloc]]
void *xcalloc(size_t nmemb, size_t size);

[[nodiscard("memory leaked")]]
void *xrealloc(void *ptr, size_t size);

[[nodiscard("memory leaked")]]
[[gnu::malloc]]
char *xstrdup(const char *s);

#endif /* XMALLOC_H */