blob: 946a497bf55e47184969e1699b3688a1a3354f8d [file] [log] [blame]
Christopher Ferrisfc26d712019-02-27 18:07:55 -08001/*
2 * Copyright (C) 2019 The Android Open Source Project
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in
12 * the documentation and/or other materials provided with the
13 * distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
18 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
19 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
22 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 */
28
29#pragma once
30
31#include <stdint.h>
32#include <stdio.h>
33#include <malloc.h>
34
35#include <private/bionic_config.h>
36
37__BEGIN_DECLS
38
39void* scudo_aligned_alloc(size_t, size_t);
40void* scudo_calloc(size_t, size_t);
41void scudo_free(void*);
42struct mallinfo scudo_mallinfo();
43void* scudo_malloc(size_t);
44int scudo_malloc_info(int, FILE*);
45size_t scudo_malloc_usable_size(const void*);
46int scudo_mallopt(int, int);
47void* scudo_memalign(size_t, size_t);
48void* scudo_realloc(void*, size_t);
49int scudo_posix_memalign(void**, size_t, size_t);
50#if defined(HAVE_DEPRECATED_MALLOC_FUNCS)
51void* scudo_pvalloc(size_t);
52void* scudo_valloc(size_t);
53#endif
54
Christopher Ferris6f517cd2019-11-08 11:28:38 -080055int scudo_malloc_iterate(uintptr_t, size_t, void (*)(uintptr_t, size_t, void*), void*);
Christopher Ferrisfc26d712019-02-27 18:07:55 -080056void scudo_malloc_disable();
57void scudo_malloc_enable();
58
Christopher Ferrise1fd4092019-12-16 16:22:55 -080059void* scudo_svelte_aligned_alloc(size_t, size_t);
60void* scudo_svelte_calloc(size_t, size_t);
61void scudo_svelte_free(void*);
62struct mallinfo scudo_svelte_mallinfo();
63void* scudo_svelte_malloc(size_t);
64int scudo_svelte_malloc_info(int, FILE*);
65size_t scudo_svelte_malloc_usable_size(const void*);
66int scudo_svelte_mallopt(int, int);
67void* scudo_svelte_memalign(size_t, size_t);
68void* scudo_svelte_realloc(void*, size_t);
69int scudo_svelte_posix_memalign(void**, size_t, size_t);
70#if defined(HAVE_DEPRECATED_MALLOC_FUNCS)
71void* scudo_svelte_pvalloc(size_t);
72void* scudo_svelte_valloc(size_t);
73#endif
74
75int scudo_svelte_malloc_iterate(uintptr_t, size_t, void (*)(uintptr_t, size_t, void*), void*);
76void scudo_svelte_malloc_disable();
77void scudo_svelte_malloc_enable();
78
Christopher Ferrisfc26d712019-02-27 18:07:55 -080079__END_DECLS