eliminate unused variable warning
[gnash.git] / libbase / jemalloc.h
blob03e0559bc9abfb4de875d867313ce3abd7b2242e
1 /* -*- Mode: C; tab-width: 8; c-basic-offset: 8 -*- */
2 /* vim:set softtabstop=8 shiftwidth=8: */
3 /*-
4 * Copyright (C) 2006-2008 Jason Evans <jasone@FreeBSD.org>.
5 * All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice(s), this list of conditions and the following disclaimer as
12 * the first lines of this file unmodified other than the possible
13 * addition of one or more copyright notices.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice(s), this list of conditions and the following disclaimer in
16 * the documentation and/or other materials provided with the
17 * distribution.
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
20 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE
23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
26 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
28 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 #ifndef _JEMALLOC_H_
33 #define _JEMALLOC_H_
35 #include "jemalloc_types.h"
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
41 extern const char *_malloc_options;
43 /* Darwin and Linux already have memory allocation functions */
44 #if (!defined(MOZ_MEMORY_DARWIN) && !defined(MOZ_MEMORY_LINUX))
45 void *malloc(size_t size);
46 void *valloc(size_t size);
47 void *calloc(size_t num, size_t size);
48 void *realloc(void *ptr, size_t size);
49 void free(void *ptr);
50 int posix_memalign(void **memptr, size_t alignment, size_t size);
51 #endif /* MOZ_MEMORY_DARWIN, MOZ_MEMORY_LINUX */
53 #if defined(MOZ_MEMORY_ANDROID) || defined(WRAP_MALLOC)
54 void *je_malloc(size_t size);
55 void *je_valloc(size_t size);
56 void *je_calloc(size_t num, size_t size);
57 void *je_realloc(void *ptr, size_t size);
58 void je_free(void *ptr);
59 int je_posix_memalign(void **memptr, size_t alignment, size_t size);
60 char *je_strndup(const char *src, size_t len);
61 char *je_strdup(const char *src);
62 #endif
64 /* Linux has memalign and malloc_usable_size */
65 #if !defined(MOZ_MEMORY_LINUX)
66 void *memalign(size_t alignment, size_t size);
67 size_t malloc_usable_size(const void *ptr);
68 #endif /* MOZ_MEMORY_LINUX */
70 void jemalloc_stats(jemalloc_stats_t *stats);
72 #ifdef __cplusplus
73 } /* extern "C" */
74 #endif
76 #endif /* _JEMALLOC_H_ */