Changeset 1077 for trunk/dll/fortify.h


Ignore:
Timestamp:
Jul 18, 2008, 8:11:54 PM (17 years ago)
Author:
Steven Levine
Message:

Enhance Fortify infrastructure
Add Fortify_SetOwner Fortify_ChangeOwner Fortify_ChangeScope
Add FORTIFY_VERBOSE_SCOPE_ENTER_EXIT support
Add more fm/2 Fortify tooling and rework existing tooling for correct nesting
Still lots to do for cross-thread allocations
Add misc.h
Add walkem.h

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/fortify.h

    r1072 r1077  
    4242
    4343 /* 06 May 08 SHL Rework scope logic to be MT capable
    44     17 Jul 08 SHL Add Fortify_SetOwner Fortify_ChangeOwner
     44    17 Jul 08 SHL Add Fortify_SetOwner Fortify_ChangeOwner Fortify_ChangeScope
    4545 */
    4646
     
    190190
    191191#ifdef MT_SCOPES
    192 void  Fortify_SetOwner(long lOwnerTID);
    193 void  Fortify_ChangeOwner(void *pBlock);
     192void Fortify_SetOwner(long lOwnerTID);
     193void Fortify_ChangeOwner(void *pBlock);
     194void Fortify_ChangeScope(void *pBlock, int delta);
    194195#endif
    195196
     
    228229     */
    229230    #ifdef FORTIFY_PROVIDE_ARRAY_NEW
    230         void *operator new[](size_t size);
    231         void *operator new[](size_t size, const char *file, unsigned long line);        // 16 Jan 08 SHL
     231        void *operator new[](size_t size);
     232        void *operator new[](size_t size, const char *file, unsigned long line);        // 16 Jan 08 SHL
    232233    #endif
    233234
     
    236237     */
    237238    #ifdef FORTIFY_PROVIDE_ARRAY_DELETE
    238         void  operator delete[](void *pointer);
     239        void  operator delete[](void *pointer);
    239240    #endif
    240241
     
    266267    /* Fortify versions of some non-ANSI C memory allocation functions */
    267268    #ifdef FORTIFY_STRDUP
    268         #define strdup(ptr)                Fortify_strdup(ptr, __FILE__, __LINE__)
     269        #define strdup(ptr)                Fortify_strdup(ptr, __FILE__, __LINE__)
    269270    #endif
    270271
    271272    /* Fortify versions of new and delete */
    272273    #ifdef __cplusplus
    273         #define Fortify_New                new(__FILE__, __LINE__)
    274         #define Fortify_Delete             for(gbl_FortifyMagic = 1, \
    275                                                Fortify_PreDelete(__FILE__, __LINE__); \
    276                                                gbl_FortifyMagic; Fortify_PostDelete()) \
    277                                                        gbl_FortifyMagic = 0, delete
    278         #define new                        Fortify_New
    279         #define delete                     Fortify_Delete
     274        #define Fortify_New                new(__FILE__, __LINE__)
     275        #define Fortify_Delete             for(gbl_FortifyMagic = 1, \
     276                                               Fortify_PreDelete(__FILE__, __LINE__); \
     277                                               gbl_FortifyMagic; Fortify_PostDelete()) \
     278                                                       gbl_FortifyMagic = 0, delete
     279        #define new                        Fortify_New
     280        #define delete                     Fortify_Delete
    280281    #endif /* __cplusplus */
    281282
Note: See TracChangeset for help on using the changeset viewer.