ipc/chromium/src/third_party/libevent/mm-internal.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/ipc/chromium/src/third_party/libevent/mm-internal.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,61 @@
     1.4 +/*
     1.5 + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
     1.6 + *
     1.7 + * Redistribution and use in source and binary forms, with or without
     1.8 + * modification, are permitted provided that the following conditions
     1.9 + * are met:
    1.10 + * 1. Redistributions of source code must retain the above copyright
    1.11 + *    notice, this list of conditions and the following disclaimer.
    1.12 + * 2. Redistributions in binary form must reproduce the above copyright
    1.13 + *    notice, this list of conditions and the following disclaimer in the
    1.14 + *    documentation and/or other materials provided with the distribution.
    1.15 + * 3. The name of the author may not be used to endorse or promote products
    1.16 + *    derived from this software without specific prior written permission.
    1.17 + *
    1.18 + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
    1.19 + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    1.20 + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    1.21 + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
    1.22 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
    1.23 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    1.24 + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    1.25 + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    1.26 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
    1.27 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    1.28 + */
    1.29 +#ifndef _EVENT_MM_INTERNAL_H
    1.30 +#define _EVENT_MM_INTERNAL_H
    1.31 +
    1.32 +#include <sys/types.h>
    1.33 +
    1.34 +#ifdef __cplusplus
    1.35 +extern "C" {
    1.36 +#endif
    1.37 +
    1.38 +#ifndef _EVENT_DISABLE_MM_REPLACEMENT
    1.39 +/* Internal use only: Memory allocation functions. We give them nice short
    1.40 + * mm_names for our own use, but make sure that the symbols have longer names
    1.41 + * so they don't conflict with other libraries (like, say, libmm). */
    1.42 +void *event_mm_malloc_(size_t sz);
    1.43 +void *event_mm_calloc_(size_t count, size_t size);
    1.44 +char *event_mm_strdup_(const char *s);
    1.45 +void *event_mm_realloc_(void *p, size_t sz);
    1.46 +void event_mm_free_(void *p);
    1.47 +#define mm_malloc(sz) event_mm_malloc_(sz)
    1.48 +#define mm_calloc(count, size) event_mm_calloc_((count), (size))
    1.49 +#define mm_strdup(s) event_mm_strdup_(s)
    1.50 +#define mm_realloc(p, sz) event_mm_realloc_((p), (sz))
    1.51 +#define mm_free(p) event_mm_free_(p)
    1.52 +#else
    1.53 +#define mm_malloc(sz) malloc(sz)
    1.54 +#define mm_calloc(n, sz) calloc((n), (sz))
    1.55 +#define mm_strdup(s) strdup(s)
    1.56 +#define mm_realloc(p, sz) realloc((p), (sz))
    1.57 +#define mm_free(p) free(p)
    1.58 +#endif
    1.59 +
    1.60 +#ifdef __cplusplus
    1.61 +}
    1.62 +#endif
    1.63 +
    1.64 +#endif

mercurial