[ada0246d] | 1 | // |
---|
| 2 | // Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo |
---|
| 3 | // |
---|
| 4 | // The contents of this file are covered under the licence agreement in the |
---|
| 5 | // file "LICENCE" distributed with Cforall. |
---|
| 6 | // |
---|
| 7 | // heap.hfa -- |
---|
| 8 | // |
---|
| 9 | // Author : Peter A. Buhr |
---|
| 10 | // Created On : Tue May 26 11:23:55 2020 |
---|
| 11 | // Last Modified By : Peter A. Buhr |
---|
[31a5f418] | 12 | // Last Modified On : Thu Apr 21 22:52:25 2022 |
---|
| 13 | // Update Count : 21 |
---|
[ada0246d] | 14 | // |
---|
| 15 | |
---|
| 16 | #pragma once |
---|
| 17 | |
---|
[31a5f418] | 18 | #include <malloc.h> |
---|
[ada0246d] | 19 | |
---|
| 20 | bool traceHeap(); |
---|
| 21 | bool traceHeapOn(); |
---|
| 22 | bool traceHeapOff(); |
---|
| 23 | |
---|
| 24 | bool traceHeapTerm(); |
---|
| 25 | bool traceHeapTermOn(); |
---|
| 26 | bool traceHeapTermOff(); |
---|
| 27 | |
---|
| 28 | bool checkFree(); |
---|
| 29 | bool checkFreeOn(); |
---|
| 30 | bool checkFreeOff(); |
---|
| 31 | |
---|
[92aca37] | 32 | // supported mallopt options |
---|
| 33 | #ifndef M_MMAP_THRESHOLD |
---|
| 34 | #define M_MMAP_THRESHOLD (-1) |
---|
[31a5f418] | 35 | #endif // M_MMAP_THRESHOLD |
---|
| 36 | |
---|
[92aca37] | 37 | #ifndef M_TOP_PAD |
---|
| 38 | #define M_TOP_PAD (-2) |
---|
| 39 | #endif // M_TOP_PAD |
---|
| 40 | |
---|
[ada0246d] | 41 | extern "C" { |
---|
[31a5f418] | 42 | // New allocation operations. |
---|
| 43 | void * aalloc( size_t dim, size_t elemSize ) __attribute__ ((malloc)); |
---|
| 44 | void * resize( void * oaddr, size_t size ) __attribute__ ((malloc)); |
---|
| 45 | void * amemalign( size_t align, size_t dim, size_t elemSize ) __attribute__ ((malloc)); |
---|
| 46 | void * cmemalign( size_t align, size_t dim, size_t elemSize ) __attribute__ ((malloc)); |
---|
[ada0246d] | 47 | size_t malloc_alignment( void * addr ); |
---|
[4e7c0fc0] | 48 | bool malloc_zero_fill( void * addr ); |
---|
| 49 | size_t malloc_size( void * addr ); |
---|
[ada0246d] | 50 | int malloc_stats_fd( int fd ); |
---|
[31a5f418] | 51 | size_t malloc_usable_size( void * addr ); |
---|
| 52 | size_t malloc_expansion(); // heap expansion size (bytes) |
---|
| 53 | size_t malloc_mmap_start(); // crossover allocation size from sbrk to mmap |
---|
| 54 | size_t malloc_unfreed(); // heap unfreed size (bytes) |
---|
[ada0246d] | 55 | } // extern "C" |
---|
| 56 | |
---|
[31a5f418] | 57 | void * resize( void * oaddr, size_t alignment, size_t size ); |
---|
| 58 | void * realloc( void * oaddr, size_t alignment, size_t size ); |
---|
| 59 | void * reallocarray( void * oaddr, size_t nalign, size_t dim, size_t elemSize ); |
---|
[ada0246d] | 60 | |
---|
| 61 | // Local Variables: // |
---|
| 62 | // mode: c // |
---|
| 63 | // tab-width: 4 // |
---|
| 64 | // End: // |
---|