00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * Mark Alexander 00008 * Side Effects Software Inc 00009 * 477 Richmond Street West 00010 * Toronto, Ontario 00011 * Canada M5V 3E7 00012 * 416-504-9876 00013 * 00014 * NAME: UT_MemUtil.h ( UT Library, C++) 00015 * 00016 * COMMENTS: 00017 * 00018 * Memory utility functions, for doing various low-level memory 00019 * operations. Currently only implemented for Linux. 00020 * 00021 */ 00022 #ifndef UT_MEM_UTIL_H 00023 #define UT_MEM_UTIL_H 00024 00025 #include "UT_API.h" 00026 #include <stddef.h> 00027 00028 enum UTmemAdvice { 00029 UT_MEM_ADVICE_NONE, // no advice. 00030 UT_MEM_ADVICE_RANDOM, // random order access - don't fetch ahead. 00031 UT_MEM_ADVICE_SEQ, // sequential access - fetch ahead aggresively. 00032 UT_MEM_ADVICE_NEEDSOON, // fetch ahead. 00033 UT_MEM_ADVICE_DONE // done with the memory for now. 00034 }; 00035 00036 UT_API int UTmemAdvise(void *mem, size_t bytes, UTmemAdvice advice); 00037 00038 // like memset, except it'll work with any arbitrary byte size of data. 00039 UT_API void UTmemsetChunk(void *dest, const void *value, int valuesize, 00040 int ncopies); 00041 00042 // attempts to return the actual # of bytes that malloc would return for a 00043 // block of 'size' bytes. 00044 UT_API size_t UTmallocSize(size_t size); 00045 00046 UT_API void UTdumpHeap(); 00047 UT_API void UTdumpMemory(void *base); 00048 00049 #endif
1.5.9