1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 #include "mozjemalloc.h"
12 MOZ_MEMORY_API
void* memalign(size_t aAlignment
, size_t aSize
) {
14 return _aligned_malloc(aSize
, aAlignment
);
17 if (posix_memalign(&ret
, aAlignment
, aSize
) != 0) {
26 #define MALLOC_DECL(name, return_type, ...) \
27 static inline return_type name(ARGS_HELPER(TYPED_ARGS, ##__VA_ARGS__)) { \
28 return ::name(ARGS_HELPER(ARGS, ##__VA_ARGS__)); \
30 #define MALLOC_FUNCS MALLOC_FUNCS_MALLOC_BASE
31 #include "malloc_decls.h"
34 #define MALLOC_DECL(name, return_type, ...) \
35 MOZ_JEMALLOC_API return_type name(ARGS_HELPER(TYPED_ARGS, ##__VA_ARGS__)) { \
36 return DummyArenaAllocator<SystemMalloc>::name( \
37 ARGS_HELPER(ARGS, ##__VA_ARGS__)); \
39 #define MALLOC_FUNCS MALLOC_FUNCS_ARENA
40 #include "malloc_decls.h"