VirtualBox

Changeset 72625 in vbox for trunk/include/iprt


Ignore:
Timestamp:
Jun 20, 2018 12:21:30 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
123127
Message:

iprt/mem.h: Added RTMEM_WILL_LEAK and RTMEM_MAY_LEAK macros for marking memory as leaked on higher levels. Made VBOX_GCC_SANITIZER_FLAGS define an IPRT friendly indicator, is VBOX_XXXX is still stricly forbidden in Runtime/.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/mem.h

    r69105 r72625  
    499499 */
    500500RTDECL(void) RTMemWipeThoroughly(void *pv, size_t cb, size_t cMinPasses) RT_NO_THROW_PROTO;
     501
     502
     503/** @def RTMEM_WILL_LEAK
     504 * Macro for hinting that a memory allocation @a a_pv will leak.
     505 *
     506 * @note This shall only be used in code that doesn't allocate the object.
     507 *       Code allocating memory knowing it will leak shall start the allocation
     508 *       tag string with 'will-leak:'.
     509 */
     510/** @def RTMEM_MAY_LEAK
     511 * Macro for hinting that a memory allocation @a a_pv may leak.
     512 *
     513 * @note This shall only be used in code that doesn't allocate the object.
     514 *       Code allocating memory knowing it may leak shall start the allocation
     515 *       tag string with 'may-leak:'.
     516 */
     517#ifdef IPRT_WITH_GCC_SANITIZER
     518# define RTMEM_WILL_LEAK(a_pv)   __lsan_ignore_object(a_pv)
     519# define RTMEM_MAY_LEAK(a_pv)    __lsan_ignore_object(a_pv)
     520#else
     521# define RTMEM_WILL_LEAK(a_pv)   do { } while (0)
     522# define RTMEM_MAY_LEAK(a_pv)    do { } while (0)
     523#endif
     524
    501525
    502526#ifdef IN_RING0
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette