Bug 926275: Remove mozalloc_macro_wrappers.h and mozalloc_undef_macro_wrappers.h. r=bsmedberg

This commit is contained in:
Daniel Holbert 2013-10-31 19:39:03 -07:00
parent 5f2cac6190
commit bd6e7083c6
8 changed files with 0 additions and 110 deletions

View File

@ -47,9 +47,6 @@
* allocated using C memory allocation functions.
*/
// Prevent the standard macros from being redefined
#define mozilla_mozalloc_macro_wrappers_h
#include "mozilla/mozalloc.h"
extern void HunspellReportMemoryAllocation(void*);

View File

@ -5,11 +5,6 @@
#ifndef BASE_MESSAGE_PUMP_QT_H_
#define BASE_MESSAGE_PUMP_QT_H_
#ifdef mozilla_mozalloc_macro_wrappers_h
/* The "anti-header" */
# include "mozilla/mozalloc_undef_macro_wrappers.h"
#endif
#include <qobject.h>
#include "base/message_pump.h"

View File

@ -11,9 +11,7 @@ EXPORTS.mozilla += [
'fallible.h',
'mozalloc.h',
'mozalloc_abort.h',
'mozalloc_macro_wrappers.h',
'mozalloc_oom.h',
'mozalloc_undef_macro_wrappers.h',
]
if CONFIG['MOZ_MSVC_STL_WRAP__RAISE'] or CONFIG['MOZ_MSVC_STL_WRAP__Throw']:

View File

@ -24,8 +24,6 @@
# define MOZALLOC_EXPORT __declspec(dllexport)
#endif
// Make sure that "malloc" et al. resolve to their libc variants.
#define MOZALLOC_DONT_DEFINE_MACRO_WRAPPERS
#include "mozilla/mozalloc.h"
#include "mozilla/mozalloc_oom.h" // for mozalloc_handle_oom

View File

@ -1,51 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: sw=4 ts=4 et :
*/
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_mozalloc_macro_wrappers_h
#define mozilla_mozalloc_macro_wrappers_h
/*
* Make libc "allocating functions" never fail (return NULL).
*
* FIXME: use infallible allocators by default after
* http://bugzilla.mozilla.org/show_bug.cgi?id=507249
* lands.
*/
#define free(_) moz_free(_)
#define malloc(_) moz_malloc(_)
#define calloc(_, __) moz_calloc(_, __)
#define realloc(_, __) moz_realloc(_, __)
/*
* Note: on some platforms, strdup may be a macro instead of a function.
* So we have to #undef it to avoid build warnings about redefining it.
*/
#undef strdup
#define strdup(_) moz_strdup(_)
#if defined(HAVE_STRNDUP)
#define strndup(_, __) moz_strndup(_, __)
#endif
#if defined(HAVE_POSIX_MEMALIGN)
#define posix_memalign(_, __, ___) moz_posix_memalign(_, __, ___)
#endif
#if defined(HAVE_MEMALIGN)
#define memalign(_, __) moz_memalign(_, __)
#endif
#if defined(HAVE_VALLOC)
#define valloc(_) moz_valloc(_)
#endif
#endif /* ifndef mozilla_mozalloc_macro_wrappers_h */

View File

@ -1,44 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: sw=4 ts=4 et :
*/
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*
* This header is the "anti-header" for mozalloc_macro_wrappers.h.
* Including it undefines all the macros defined by
* mozalloc_macro_wrappers.h.
*/
#ifndef mozilla_mozalloc_macro_wrappers_h
# error "mozalloc macro wrappers haven't been defined"
#endif
/*
* This allows the wrappers to be redefined by including
* mozalloc_macro_wrappers.h again
*/
#undef mozilla_mozalloc_macro_wrappers_h
#undef free
#undef malloc
#undef calloc
#undef realloc
#undef strdup
#if defined(HAVE_STRNDUP)
# undef strndup
#endif
#if defined(HAVE_POSIX_MEMALIGN)
# undef posix_memalign
#endif
#if defined(HAVE_MEMALIGN)
# undef memalign
#endif
#if defined(HAVE_VALLOC)
# undef valloc
#endif

View File

@ -37,8 +37,6 @@
#include <errno.h>
#include <dlfcn.h>
#include "mozilla/mozalloc_undef_macro_wrappers.h"
// Must define before including jprof.h
void *moz_xmalloc(size_t size)
{

View File

@ -17,7 +17,6 @@
/* Definitions of functions and operators that allocate memory. */
#if !defined(XPCOM_GLUE) && !defined(NS_NO_XPCOM) && !defined(MOZ_NO_MOZALLOC)
# include "mozilla/mozalloc.h"
# include "mozilla/mozalloc_macro_wrappers.h"
#endif
/**