/usr/include/trilinos/ml_memory.h is in libtrilinos-ml-dev 12.10.1-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | /* ******************************************************************** */
/* See the file COPYRIGHT for a complete copyright notice, contact */
/* person and disclaimer. */
/* ******************************************************************** */
/* ******************************************************************** */
/* ML memory management functions */
/* ******************************************************************** */
/* Author : Charles Tong (LLNL) */
/* Date : April, 1998 */
/* ******************************************************************** */
#ifndef __MLMEM__
#define __MLMEM__
#include <stdio.h>
#include <stdlib.h>
#include "ml_common.h"
#define MAX_MALLOC_LOG 1000
#define ml_size_t size_t
#ifndef ML_CPP
#ifdef __cplusplus
extern "C"
{
#endif
#endif
#ifndef ML_MEM_CHECK
extern void ML_free(void *);
extern void *ML_allocate(ml_size_t size);
#endif
#ifndef ML_CPP
#ifdef __cplusplus
}
#endif
#endif
#ifndef ML_MEM_CHECK
#define ML_allocate(i) malloc((i + sizeof(double) ))
#define ML_realloc(i,j) realloc(i,j)
#if defined(__cplusplus) && defined(_MSC_VER)
extern "C" void *ml_void_mem_ptr;
#else
extern void *ml_void_mem_ptr;
#endif
#define ML_free(i) { ml_void_mem_ptr = (void *) i; if (ml_void_mem_ptr != NULL) {free( (void*) i); i = NULL;} }
#else
#define ML_free(i) { ML_myfree(i); i = NULL; }
#define ML_realloc(i,j) ML_myrealloc(i,j)
#endif
#define ML_allocate_check(ptr_to_check) \
{if ((ptr_to_check) == NULL) {\
printf("In file %s (line %d): memory allocation failed for pointer #%lu\n", __FILE__, __LINE__, (long unsigned int) ptr_to_check);\
exit(1);\
}\
}
#ifndef ML_CPP
#ifdef __cplusplus
extern "C"
{
#endif
#endif
extern char *ML_memory_check(char *fmt, ...);
extern int ML_memory_alloc( void **, unsigned int, char const * );
extern int ML_memory_free( void ** );
extern int ML_memory_check_var(void *);
extern int ML_memory_inquire(void);
extern int ML_memory_inquire_short( int );
extern int ML_memory_clean( char *, int );
#ifdef ML_MEM_CHECK
extern void ML_print_it();
extern char *ML_allocate(unsigned int isize);
extern void ML_myfree(void *vptr);
extern char *ML_myrealloc(void *vptr, unsigned int new_size);
extern void ML_spit_it_out();
#endif
extern int ML_MaxAllocatableSize();
extern int ML_MaxMemorySize();
#ifndef ML_CPP
#ifdef __cplusplus
}
#endif
#endif
#endif
|