📄 mpalloc.c
字号:
else if (f == AT_MEMMEM) { if (m > 0) while (l >= m) { if ((*((char *) p) == *((char *) q)) && ((m == 1) || !memcmp((char *) p + 1, (char *) q + 1, m - 1))) return p; p = (char *) p + 1; l--; } return NULL; } illegalfunction("__mp_locatemem", s, t, u); return NULL;}/* Compare two blocks of memory. */MP_APIint__mp_comparemem(void *p, void *q, size_t l, alloctype f, char *s, char *t, unsigned long u, size_t k){ if ((f != AT_MEMCMP) && (f != AT_BCMP)) illegalfunction("__mp_comparemem", s, t, u); return memcmp(p, q, l);}/* Return the full version number of the mpatrol library. */MP_APIunsigned long__mp_libversion(void){ return MP_VERNUM;}/* Return an error message corresponding to a given error type. */MP_APIchar *__mp_strerror(errortype e){ return NULL;}/* Return the name of the function corresponding to a given allocation type. */MP_APIchar *__mp_function(alloctype f){ return NULL;}/* Set the user data for a given memory allocation. */MP_APIint__mp_setuser(void *p, void *d){ return 0;}/* Set the marked flag for a given memory allocation. */MP_APIint__mp_setmark(void *p){ return 0;}/* Obtain any details about the memory block that contains a given address. */MP_APIint__mp_info(void *p, allocinfo *d){ return 0;}/* Obtain any details about the function symbol that contains a given address. */MP_APIint__mp_syminfo(void *p, symbolinfo *d){ return 0;}/* Obtain the name of the function symbol that contains a given address. */MP_APIchar *__mp_symbol(void *p){ return NULL;}/* Display any details about the memory block that contains a given address. * This is for calling within a symbolic debugger and will result in output to * the standard error file stream instead of the log file. */MP_APIint__mp_printinfo(void *p){ return 0;}/* Return the current allocation event count for later use when examining * the difference in the list of allocations between now and a future point. */MP_APIunsigned long__mp_snapshot(void){ return 0;}/* Iterate over all of the allocated and freed memory blocks, calling a * user-supplied function for each one encountered. */MP_APIsize_t__mp_iterate(int (*f)(void *, void *), void *d, unsigned long s){ return 0;}/* Iterate over all of the allocated, freed and free memory blocks, calling * a user-supplied function for each one encountered. */MP_APIsize_t__mp_iterateall(int (*f)(void *, void *), void *d){ return 0;}/* Add a memory allocation to the leak table. */MP_APIint__mp_addallocentry(char *f, unsigned long l, size_t c){ return 0;}/* Remove a memory allocation from the leak table. */MP_APIint__mp_addfreeentry(char *f, unsigned long l, size_t c){ return 0;}/* Clear the leak table. */MP_APIvoid__mp_clearleaktable(void){}/* Start recording memory allocation events in the leak table. */MP_APIint__mp_startleaktable(void){ return 0;}/* Stop recording memory allocation events in the leak table. */MP_APIint__mp_stopleaktable(void){ return 0;}/* Display the leak table. */MP_APIvoid__mp_leaktable(size_t l, int o, unsigned char f){}/* Display a complete memory map of the heap and (optionally) a summary of * all mpatrol library settings and statistics. */MP_APIvoid__mp_memorymap(int s){}/* Display a summary of all mpatrol library settings and statistics. */MP_APIvoid__mp_summary(void){}/* Return statistics about the current state of the heap. */MP_APIint__mp_stats(heapinfo *d){ return 0;}/* Check the validity of all memory blocks that have been filled with * a predefined pattern. */MP_APIvoid__mp_checkheap(char *s, char *t, unsigned long u){}/* Check the validity of all memory blocks that have been filled with * a predefined pattern. */MP_APIvoid__mp_check(void){}/* Set the prologue function and return the previous setting. */MP_APIprologuehandler__mp_prologue(prologuehandler h){ return NULL;}/* Set the epilogue function and return the previous setting. */MP_APIepiloguehandler__mp_epilogue(epiloguehandler h){ return NULL;}/* Set the low-memory handler and return the previous setting. */MP_APInomemoryhandler__mp_nomemory(nomemoryhandler h){ return NULL;}/* Push source level information onto the top of the delete stack. */MP_APIvoid__mp_pushdelstack(char *s, char *t, unsigned long u){}/* Pop source level information off the top of the delete stack. */MP_APIvoid__mp_popdelstack(char **s, char **t, unsigned long *u){ *s = *t = NULL; *u = 0;}/* Write user data to the mpatrol log file. */MP_APIint__mp_printf(char *s, ...){ return 0;}/* Write user data to the mpatrol log file. */MP_APIint__mp_vprintf(char *s, va_list v){ return 0;}/* Write user data to the mpatrol log file along with location information. */MP_APIvoid__mp_printfwithloc(char *s, char *t, unsigned long u, char *m, ...){}/* Write user data to the mpatrol log file along with location information. */MP_APIvoid__mp_vprintfwithloc(char *s, char *t, unsigned long u, char *m, va_list v){}/* Write a hex dump for a specified memory location to the mpatrol log file. */MP_APIvoid__mp_logmemory(void *p, size_t l){}/* Write the current call stack to the mpatrol log file. */MP_APIint__mp_logstack(size_t k){ return 0;}/* Write the details about the memory block that contains a given address to * the mpatrol log file. */MP_APIint__mp_logaddr(void *p){ return 0;}/* Invoke a text editor on a given source file at a specific line. */MP_APIint__mp_edit(char *f, unsigned long l){ return 0;}/* List a given source file at a specific line. */MP_APIint__mp_list(char *f, unsigned long l){ return 0;}/* Edit or list a given source file at a specific line, but only if the EDIT * or LIST options are in effect. */MP_APIint__mp_view(char *f, unsigned long l){ return 0;}/* Read in an allocation contents file. */MP_APIint__mp_readcontents(char *s, void *p){ return 0;}/* Write out an allocation contents file. */MP_APIint__mp_writecontents(char *s, void *p){ return 0;}/* Compare an allocation contents file with the contents currently in memory. */MP_APIlong__mp_cmpcontents(char *s, void *p){ return -1;}/* Remove an allocation contents file. */MP_APIint__mp_remcontents(char *s, void *p){ return 0;}/* The function that is called at every function prologue. */MP_APIvoid__cyg_profile_func_enter(void *a, void *p){}/* The function that is called at every function epilogue. */MP_APIvoid__cyg_profile_func_exit(void *a, void *p){}/* Set the access rights for a block of memory using the checker interface. */MP_APIvoidchkr_set_right(void *p, size_t l, unsigned char a){}/* Copy the access rights for a block of memory to another block using the * checker interface. */MP_APIvoidchkr_copy_bitmap(void *p, void *q, size_t l){}/* Check a block of memory using the checker interface. */MP_APIvoidchkr_check_addr(void *p, size_t l, unsigned char a){}/* Check a string using the checker interface. */MP_APIvoidchkr_check_str(char *p, unsigned char a){}/* Check a function pointer using the checker interface. */MP_APIvoidchkr_check_exec(void *p){}#ifdef __cplusplus}#endif /* __cplusplus */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -