Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:27:16

0001 //
0002 // Copyright 2018 The Abseil Authors.
0003 //
0004 // Licensed under the Apache License, Version 2.0 (the "License");
0005 // you may not use this file except in compliance with the License.
0006 // You may obtain a copy of the License at
0007 //
0008 //      https://www.apache.org/licenses/LICENSE-2.0
0009 //
0010 // Unless required by applicable law or agreed to in writing, software
0011 // distributed under the License is distributed on an "AS IS" BASIS,
0012 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0013 // See the License for the specific language governing permissions and
0014 // limitations under the License.
0015 
0016 // Helper function for measuring stack consumption of signal handlers.
0017 
0018 #ifndef ABSL_DEBUGGING_INTERNAL_STACK_CONSUMPTION_H_
0019 #define ABSL_DEBUGGING_INTERNAL_STACK_CONSUMPTION_H_
0020 
0021 #include "absl/base/config.h"
0022 
0023 // The code in this module is not portable.
0024 // Use this feature test macro to detect its availability.
0025 #ifdef ABSL_INTERNAL_HAVE_DEBUGGING_STACK_CONSUMPTION
0026 #error ABSL_INTERNAL_HAVE_DEBUGGING_STACK_CONSUMPTION cannot be set directly
0027 #elif !defined(__APPLE__) && !defined(_WIN32) &&                     \
0028     (defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || \
0029      defined(__aarch64__) || defined(__riscv))
0030 #define ABSL_INTERNAL_HAVE_DEBUGGING_STACK_CONSUMPTION 1
0031 
0032 namespace absl {
0033 ABSL_NAMESPACE_BEGIN
0034 namespace debugging_internal {
0035 
0036 // Returns the stack consumption in bytes for the code exercised by
0037 // signal_handler.  To measure stack consumption, signal_handler is registered
0038 // as a signal handler, so the code that it exercises must be async-signal
0039 // safe.  The argument of signal_handler is an implementation detail of signal
0040 // handlers and should ignored by the code for signal_handler.  Use global
0041 // variables to pass information between your test code and signal_handler.
0042 int GetSignalHandlerStackConsumption(void (*signal_handler)(int));
0043 
0044 }  // namespace debugging_internal
0045 ABSL_NAMESPACE_END
0046 }  // namespace absl
0047 
0048 #endif  // ABSL_INTERNAL_HAVE_DEBUGGING_STACK_CONSUMPTION
0049 
0050 #endif  // ABSL_DEBUGGING_INTERNAL_STACK_CONSUMPTION_H_