diff options
| author | Greg Hudson <ghudson@mit.edu> | 2009-11-24 01:25:10 +0000 |
|---|---|---|
| committer | Greg Hudson <ghudson@mit.edu> | 2009-11-24 01:25:10 +0000 |
| commit | d8ea32176611219e8ee3a9281ab8c2f1d718de77 (patch) | |
| tree | 485ea22c66460808baa9e26cf6552cec37fdc467 /src/include | |
| parent | d55064e02f1078be49e9ff4200bc98cff7002834 (diff) | |
| download | krb5-d8ea32176611219e8ee3a9281ab8c2f1d718de77.tar.gz krb5-d8ea32176611219e8ee3a9281ab8c2f1d718de77.tar.xz krb5-d8ea32176611219e8ee3a9281ab8c2f1d718de77.zip | |
Punt the volatile cast in the non-gcc, non-Windows version of zap.
Use a function call into libkrb5support instead, since that's hard to
inline.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23339 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/k5-int.h | 5 | ||||
| -rw-r--r-- | src/include/k5-platform.h | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/include/k5-int.h b/src/include/k5-int.h index 2edf1d511..3d5268836 100644 --- a/src/include/k5-int.h +++ b/src/include/k5-int.h @@ -790,8 +790,9 @@ static inline void zap(void *ptr, size_t len) asm volatile ("" : : "g" (ptr), "g" (len)); } #else -# define zap(ptr, len) memset((void *)(volatile void *)ptr, 0, len) -#endif /* WIN32 */ +/* Use a function from libkrb5support to defeat inlining. */ +# define zap(ptr, len) krb5int_zap(ptr, len) +#endif /* Convenience function: zap and free ptr if it is non-NULL. */ static inline void diff --git a/src/include/k5-platform.h b/src/include/k5-platform.h index 7c1c57d70..ee3730ad0 100644 --- a/src/include/k5-platform.h +++ b/src/include/k5-platform.h @@ -976,6 +976,8 @@ extern int krb5int_mkstemp(char *); #define mkstemp krb5int_mkstemp #endif +extern void krb5int_zap(void *ptr, size_t len); + /* Fudge for future adoption of gettext or the like. */ #ifndef _ #define _(X) (X) |
