LCOV - code coverage report
Current view: top level - memory/build - malloc_decls.h (source / functions) Hit Total Coverage
Test: output.info Lines: 14 14 100.0 %
Date: 2017-07-14 16:53:18 Functions: 8 14 57.1 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* This Source Code Form is subject to the terms of the Mozilla Public
       2             :  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
       3             :  * You can obtain one at http://mozilla.org/MPL/2.0/. */
       4             : 
       5             : /*
       6             :  * Helper header to declare all the supported malloc functions.
       7             :  * MALLOC_DECL arguments are:
       8             :  *   - function name
       9             :  *   - return type
      10             :  *   - argument types
      11             :  */
      12             : 
      13             : #ifndef malloc_decls_h
      14             : #  define malloc_decls_h
      15             : 
      16             : #  include "mozjemalloc_types.h"
      17             : 
      18             : #ifndef MALLOC_USABLE_SIZE_CONST_PTR
      19             : #define MALLOC_USABLE_SIZE_CONST_PTR const
      20             : #endif
      21             : 
      22             : typedef MALLOC_USABLE_SIZE_CONST_PTR void * usable_ptr_t;
      23             : 
      24             : #  define MALLOC_FUNCS_MALLOC 1
      25             : #  define MALLOC_FUNCS_JEMALLOC 2
      26             : #  define MALLOC_FUNCS_INIT 4
      27             : #  define MALLOC_FUNCS_BRIDGE 8
      28             : #  define MALLOC_FUNCS_ALL (MALLOC_FUNCS_INIT | MALLOC_FUNCS_BRIDGE | \
      29             :                             MALLOC_FUNCS_MALLOC | MALLOC_FUNCS_JEMALLOC)
      30             : 
      31             : #endif /* malloc_decls_h */
      32             : 
      33             : #ifndef MALLOC_FUNCS
      34             : #  define MALLOC_FUNCS (MALLOC_FUNCS_MALLOC | MALLOC_FUNCS_JEMALLOC)
      35             : #endif
      36             : 
      37             : #ifdef MALLOC_DECL
      38             : #  ifndef MALLOC_DECL_VOID
      39             : #    define MALLOC_DECL_VOID(func, ...) MALLOC_DECL(func, void, __VA_ARGS__)
      40             : #  endif
      41             : 
      42             : #  if MALLOC_FUNCS & MALLOC_FUNCS_INIT
      43             : MALLOC_DECL(init, void, const malloc_table_t *)
      44             : #  endif
      45             : #  if MALLOC_FUNCS & MALLOC_FUNCS_BRIDGE
      46             : MALLOC_DECL(get_bridge, struct ReplaceMallocBridge*)
      47             : #  endif
      48             : #  if MALLOC_FUNCS & MALLOC_FUNCS_MALLOC
      49      938871 : MALLOC_DECL(malloc, void *, size_t)
      50          67 : MALLOC_DECL(posix_memalign, int, void **, size_t, size_t)
      51           6 : MALLOC_DECL(aligned_alloc, void *, size_t, size_t)
      52      119479 : MALLOC_DECL(calloc, void *, size_t, size_t)
      53      161449 : MALLOC_DECL(realloc, void *, void *, size_t)
      54      755444 : MALLOC_DECL_VOID(free, void *)
      55         118 : MALLOC_DECL(memalign, void *, size_t, size_t)
      56           6 : MALLOC_DECL(valloc, void *, size_t)
      57       21987 : MALLOC_DECL(malloc_usable_size, size_t, usable_ptr_t)
      58        8852 : MALLOC_DECL(malloc_good_size, size_t, size_t)
      59             : #  endif
      60             : #  if MALLOC_FUNCS & MALLOC_FUNCS_JEMALLOC
      61           6 : MALLOC_DECL_VOID(jemalloc_stats, jemalloc_stats_t *)
      62           6 : MALLOC_DECL_VOID(jemalloc_purge_freed_pages)
      63           6 : MALLOC_DECL_VOID(jemalloc_free_dirty_pages)
      64           6 : MALLOC_DECL_VOID(jemalloc_thread_local_arena, jemalloc_bool)
      65             : #  endif
      66             : 
      67             : #  undef MALLOC_DECL_VOID
      68             : #endif /* MALLOC_DECL */
      69             : 
      70             : #undef MALLOC_DECL
      71             : #undef MALLOC_FUNCS

Generated by: LCOV version 1.13