diff options
Diffstat (limited to 'xpcom/build/PoisonIOInterposer.h')
-rw-r--r-- | xpcom/build/PoisonIOInterposer.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/xpcom/build/PoisonIOInterposer.h b/xpcom/build/PoisonIOInterposer.h index 6a34e39a0c..20edbd5aa8 100644 --- a/xpcom/build/PoisonIOInterposer.h +++ b/xpcom/build/PoisonIOInterposer.h @@ -35,7 +35,7 @@ void MozillaUnRegisterDebugFILE(FILE* aFile); MOZ_END_EXTERN_C -#if defined(XP_WIN) +#if defined(XP_WIN) || defined(XP_MACOSX) #ifdef __cplusplus namespace mozilla { @@ -53,6 +53,16 @@ bool IsDebugFile(intptr_t aFileID); */ void InitPoisonIOInterposer(); +#ifdef XP_MACOSX +/** + * Check that writes are dirty before reporting I/O (Mac OS X only) + * This is necessary for late-write checks on Mac OS X, but reading the buffer + * from file to see if we're writing dirty bits is expensive, so we don't want + * to do this for everything else that uses + */ +void OnlyReportDirtyWrites(); +#endif /* XP_MACOSX */ + /** * Clear IO poisoning, this is only safe to do on the main-thread when no other * threads are running. @@ -62,16 +72,19 @@ void ClearPoisonIOInterposer(); } // namespace mozilla #endif /* __cplusplus */ -#else /* XP_WIN */ +#else /* XP_WIN || XP_MACOSX */ #ifdef __cplusplus namespace mozilla { inline bool IsDebugFile(intptr_t aFileID) { return true; } inline void InitPoisonIOInterposer() {} inline void ClearPoisonIOInterposer() {} +#ifdef XP_MACOSX +inline void OnlyReportDirtyWrites() {} +#endif /* XP_MACOSX */ } // namespace mozilla #endif /* __cplusplus */ -#endif /* XP_WIN */ +#endif /* XP_WIN || XP_MACOSX */ #endif // mozilla_PoisonIOInterposer_h |