diff options
author | Abseil Team <absl-team@google.com> | 2024-03-26 11:41:28 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2024-03-26 11:42:35 -0700 |
commit | e7858c73279d81cbc005d9c76a385ab535520635 (patch) | |
tree | a6e9e216f48878fd1c8dae4a6e36af4992c7af1c /absl/base | |
parent | 86f3019430baa53ca1bc38b7e370fcd5fc8d2503 (diff) | |
download | abseil-e7858c73279d81cbc005d9c76a385ab535520635.tar.gz abseil-e7858c73279d81cbc005d9c76a385ab535520635.tar.bz2 abseil-e7858c73279d81cbc005d9c76a385ab535520635.zip |
Revert integer-to-string conversion optimizations pending more thorough analysis
PiperOrigin-RevId: 619261152
Change-Id: Id3409b326c52ace0fda42537e0b91dbb2d6a2287
Diffstat (limited to 'absl/base')
-rw-r--r-- | absl/base/macros.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/absl/base/macros.h b/absl/base/macros.h index 33c1cd1e..b318f116 100644 --- a/absl/base/macros.h +++ b/absl/base/macros.h @@ -174,4 +174,16 @@ ABSL_NAMESPACE_END #define ABSL_DEPRECATE_AND_INLINE() #endif +// Requires the compiler to prove that the size of the given object is at least +// the expected amount. +#if ABSL_HAVE_ATTRIBUTE(diagnose_if) && ABSL_HAVE_BUILTIN(__builtin_object_size) +#define ABSL_INTERNAL_NEED_MIN_SIZE(Obj, N) \ + __attribute__((diagnose_if(__builtin_object_size(Obj, 0) < N, \ + "object size provably too small " \ + "(this would corrupt memory)", \ + "error"))) +#else +#define ABSL_INTERNAL_NEED_MIN_SIZE(Obj, N) +#endif + #endif // ABSL_BASE_MACROS_H_ |