⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 valgrind.h

📁 带mod_cache的lighttpd服务器,性能有很大提高,可以让一个1G带宽跑满不是神话 使用是直接解压后./configure -C就可以生成mod_cache模块的lighttpd.
💻 H
📖 第 1 页 / 共 2 页
字号:
          /* These are useful and can be interpreted by any tool that tracks             malloc() et al, by using vg_replace_malloc.c. */          VG_USERREQ__MALLOCLIKE_BLOCK = 0x1301,          VG_USERREQ__FREELIKE_BLOCK   = 0x1302,          /* Memory pool support. */          VG_USERREQ__CREATE_MEMPOOL   = 0x1303,          VG_USERREQ__DESTROY_MEMPOOL  = 0x1304,          VG_USERREQ__MEMPOOL_ALLOC    = 0x1305,          VG_USERREQ__MEMPOOL_FREE     = 0x1306,          /* Allow printfs to valgrind log. */          VG_USERREQ__PRINTF           = 0x1401,          VG_USERREQ__PRINTF_BACKTRACE = 0x1402,          /* Stack support. */          VG_USERREQ__STACK_REGISTER   = 0x1501,          VG_USERREQ__STACK_DEREGISTER = 0x1502,          VG_USERREQ__STACK_CHANGE     = 0x1503,   } Vg_ClientRequest;#ifndef __GNUC__#define __extension__#endif/* Returns the number of Valgrinds this code is running under.  That is,   0 if running natively, 1 if running under Valgrind, 2 if running under   Valgrind which is running under another Valgrind, etc. */#define RUNNING_ON_VALGRIND  __extension__                         \   ({unsigned int _qzz_res;                                        \    VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0 /* returned if not */,     \                            VG_USERREQ__RUNNING_ON_VALGRIND,       \                            0, 0, 0, 0);                           \    _qzz_res;                                                      \   })/* Discard translation of code in the range [_qzz_addr .. _qzz_addr +   _qzz_len - 1].  Useful if you are debugging a JITter or some such,   since it provides a way to make sure valgrind will retranslate the   invalidated area.  Returns no value. */#define VALGRIND_DISCARD_TRANSLATIONS(_qzz_addr,_qzz_len)          \   {unsigned int _qzz_res;                                         \    VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0,                           \                            VG_USERREQ__DISCARD_TRANSLATIONS,      \                            _qzz_addr, _qzz_len, 0, 0);            \   }#ifdef NVALGRIND#define VALGRIND_PRINTF(...)#define VALGRIND_PRINTF_BACKTRACE(...)#else /* NVALGRIND */int VALGRIND_PRINTF(const char *format, ...)   __attribute__((format(__printf__, 1, 2)));__attribute__((weak))intVALGRIND_PRINTF(const char *format, ...){   unsigned long _qzz_res;   va_list vargs;   va_start(vargs, format);   VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0, VG_USERREQ__PRINTF,                           (unsigned long)format, (unsigned long)vargs, 0, 0);   va_end(vargs);   return (int)_qzz_res;}int VALGRIND_PRINTF_BACKTRACE(const char *format, ...)   __attribute__((format(__printf__, 1, 2)));__attribute__((weak))intVALGRIND_PRINTF_BACKTRACE(const char *format, ...){   unsigned long _qzz_res;   va_list vargs;   va_start(vargs, format);   VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0, VG_USERREQ__PRINTF_BACKTRACE,                           (unsigned long)format, (unsigned long)vargs, 0, 0);   va_end(vargs);   return (int)_qzz_res;}#endif /* NVALGRIND *//* These requests allow control to move from the simulated CPU to the   real CPU, calling an arbitary function */#define VALGRIND_NON_SIMD_CALL0(_qyy_fn)                       \   ({unsigned long _qyy_res;                                   \    VALGRIND_MAGIC_SEQUENCE(_qyy_res, 0 /* default return */,  \                            VG_USERREQ__CLIENT_CALL0,          \                            _qyy_fn,                           \                            0, 0, 0);                          \    _qyy_res;                                                  \   })#define VALGRIND_NON_SIMD_CALL1(_qyy_fn, _qyy_arg1)            \   ({unsigned long _qyy_res;                                   \    VALGRIND_MAGIC_SEQUENCE(_qyy_res, 0 /* default return */,  \                            VG_USERREQ__CLIENT_CALL1,          \                            _qyy_fn,                           \                            _qyy_arg1, 0, 0);                  \    _qyy_res;                                                  \   })#define VALGRIND_NON_SIMD_CALL2(_qyy_fn, _qyy_arg1, _qyy_arg2) \   ({unsigned long _qyy_res;                                   \    VALGRIND_MAGIC_SEQUENCE(_qyy_res, 0 /* default return */,  \                            VG_USERREQ__CLIENT_CALL2,          \                            _qyy_fn,                           \                            _qyy_arg1, _qyy_arg2, 0);          \    _qyy_res;                                                  \   })#define VALGRIND_NON_SIMD_CALL3(_qyy_fn, _qyy_arg1, _qyy_arg2, _qyy_arg3)  \   ({unsigned long _qyy_res;                                         \    VALGRIND_MAGIC_SEQUENCE(_qyy_res, 0 /* default return */,        \                            VG_USERREQ__CLIENT_CALL3,                \                            _qyy_fn,                                 \                            _qyy_arg1, _qyy_arg2, _qyy_arg3);        \    _qyy_res;                                                        \   })/* Counts the number of errors that have been recorded by a tool.  Nb:   the tool must record the errors with VG_(maybe_record_error)() or   VG_(unique_error)() for them to be counted. */#define VALGRIND_COUNT_ERRORS                                           \   ({unsigned int _qyy_res;                                             \    VALGRIND_MAGIC_SEQUENCE(_qyy_res, 0 /* default return */,           \                            VG_USERREQ__COUNT_ERRORS,                   \                            0, 0, 0, 0);                                \    _qyy_res;                                                           \   })/* Mark a block of memory as having been allocated by a malloc()-like   function.  `addr' is the start of the usable block (ie. after any   redzone) `rzB' is redzone size if the allocator can apply redzones;   use '0' if not.  Adding redzones makes it more likely Valgrind will spot   block overruns.  `is_zeroed' indicates if the memory is zeroed, as it is   for calloc().  Put it immediately after the point where a block is   allocated.       If you're allocating memory via superblocks, and then handing out small   chunks of each superblock, if you don't have redzones on your small   blocks, it's worth marking the superblock with VALGRIND_MAKE_NOACCESS   when it's created, so that block overruns are detected.  But if you can   put redzones on, it's probably better to not do this, so that messages   for small overruns are described in terms of the small block rather than   the superblock (but if you have a big overrun that skips over a redzone,   you could miss an error this way).  See memcheck/tests/custom_alloc.c   for an example.   Nb: block must be freed via a free()-like function specified   with VALGRIND_FREELIKE_BLOCK or mismatch errors will occur. */#define VALGRIND_MALLOCLIKE_BLOCK(addr, sizeB, rzB, is_zeroed)     \   {unsigned int _qzz_res;                                         \    VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0,                           \                            VG_USERREQ__MALLOCLIKE_BLOCK,          \                            addr, sizeB, rzB, is_zeroed);          \   }/* Mark a block of memory as having been freed by a free()-like function.   `rzB' is redzone size;  it must match that given to   VALGRIND_MALLOCLIKE_BLOCK.  Memory not freed will be detected by the leak   checker.  Put it immediately after the point where the block is freed. */#define VALGRIND_FREELIKE_BLOCK(addr, rzB)                         \   {unsigned int _qzz_res;                                         \    VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0,                           \                            VG_USERREQ__FREELIKE_BLOCK,            \                            addr, rzB, 0, 0);                      \   }/* Create a memory pool. */#define VALGRIND_CREATE_MEMPOOL(pool, rzB, is_zeroed)              \   {unsigned int _qzz_res;                                         \    VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0,                           \                            VG_USERREQ__CREATE_MEMPOOL,            \                            pool, rzB, is_zeroed, 0);              \   }/* Destroy a memory pool. */#define VALGRIND_DESTROY_MEMPOOL(pool)                             \   {unsigned int _qzz_res;                                         \    VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0,                           \                            VG_USERREQ__DESTROY_MEMPOOL,           \                            pool, 0, 0, 0);                        \   }/* Associate a piece of memory with a memory pool. */#define VALGRIND_MEMPOOL_ALLOC(pool, addr, size)                   \   {unsigned int _qzz_res;                                         \    VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0,                           \                            VG_USERREQ__MEMPOOL_ALLOC,             \                            pool, addr, size, 0);                  \   }/* Disassociate a piece of memory from a memory pool. */#define VALGRIND_MEMPOOL_FREE(pool, addr)                          \   {unsigned int _qzz_res;                                         \    VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0,                           \                            VG_USERREQ__MEMPOOL_FREE,              \                            pool, addr, 0, 0);                     \   }/* Mark a piece of memory as being a stack. Returns a stack id. */#define VALGRIND_STACK_REGISTER(start, end)                        \   ({unsigned int _qzz_res;                                        \    VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0,                           \                            VG_USERREQ__STACK_REGISTER,            \                            start, end, 0, 0);                     \    _qzz_res;                                                      \   })/* Unmark the piece of memory associated with a stack id as being a   stack. */#define VALGRIND_STACK_DEREGISTER(id)                              \   {unsigned int _qzz_res;                                         \    VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0,                           \                            VG_USERREQ__STACK_DEREGISTER,          \                            id, 0, 0, 0);                          \   }/* Change the start and end address of the stack id. */#define VALGRIND_STACK_CHANGE(id, start, end)                      \   {unsigned int _qzz_res;                                         \    VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0,                           \                            VG_USERREQ__STACK_CHANGE,              \                            id, start, end, 0);                    \   }#endif   /* __VALGRIND_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -