Skip to content

Commit

Permalink
Changes imported from Abseil "staging" branch:
Browse files Browse the repository at this point in the history
  - db061dd2b795837e6154be0991077ca5a03ec471 Release the async-signal safe demangler as an internal im... by Derek Mauro <[email protected]>
  - 310440eb33d946df79d26bf1edf795f6a0b466b9 Use static_cast to constrain nanoseconds to int range, av... by Abseil Team <[email protected]>

GitOrigin-RevId: db061dd2b795837e6154be0991077ca5a03ec471
Change-Id: Ibc1bc1db355a48115451da5ce88d66a1f6e1a182
  • Loading branch information
Abseil Team authored and derekmauro committed Feb 22, 2018
1 parent 03c1513 commit dca2eb5
Show file tree
Hide file tree
Showing 6 changed files with 2,182 additions and 2 deletions.
2 changes: 1 addition & 1 deletion absl/base/internal/spinlock_wait.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ int SpinLockSuggestedDelayNS(int loop) {
// Mean is exponential in loop for first 32 iterations, then 8ms.
// The futex path multiplies this by 16, since we expect explicit wakeups
// almost always on that path.
return r >> (44 - (loop >> 3));
return static_cast<int>(r >> (44 - (loop >> 3)));
}

} // namespace base_internal
Expand Down
24 changes: 24 additions & 0 deletions absl/debugging/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,34 @@ cc_library(
deps = [
"//absl/base",
"//absl/base:dynamic_annotations",
],
)

cc_library(
name = "demangle_internal",
srcs = ["internal/demangle.cc"],
hdrs = ["internal/demangle.h"],
copts = ABSL_DEFAULT_COPTS,
deps = [
"//absl/base",
"//absl/base:core_headers",
],
)

cc_test(
name = "demangle_test",
srcs = ["internal/demangle_test.cc"],
copts = ABSL_TEST_COPTS,
deps = [
":demangle_internal",
":stack_consumption",
"//absl/base",
"//absl/base:core_headers",
"//absl/memory",
"@com_google_googletest//:gtest_main",
],
)

cc_library(
name = "leak_check",
srcs = select({
Expand Down
38 changes: 37 additions & 1 deletion absl/debugging/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ list(APPEND DEBUGGING_PUBLIC_HEADERS

list(APPEND DEBUGGING_INTERNAL_HEADERS
"internal/address_is_readable.h"
"internal/demangle.h"
"internal/elf_mem_image.h"
"internal/stacktrace_config.h"
"internal/vdso_support.h"
Expand All @@ -31,6 +32,7 @@ list(APPEND DEBUGGING_INTERNAL_HEADERS
list(APPEND STACKTRACE_SRC
"stacktrace.cc"
"internal/address_is_readable.cc"
"internal/demangle.cc"
"internal/elf_mem_image.cc"
"internal/vdso_support.cc"
${DEBUGGING_PUBLIC_HEADERS}
Expand Down Expand Up @@ -79,6 +81,41 @@ absl_header_library(
## TESTS
#

list(APPEND DEBUGGING_INTERNAL_TEST_HEADERS
"internal/stack_consumption.h"
)

list(APPEND STACK_CONSUMPTION_SRC
"internal/stack_consumption.cc"
${DEBUGGING_INTERNAL_TEST_HEADERS}
)

absl_library(
TARGET
absl_stack_consumption
SOURCES
${STACK_CONSUMPTION_SRC}
)

absl_test(
TARGET
absl_stack_consumption_test
SOURCES
${STACK_CONSUMPTION_SRC}
)

list(APPEND DEMANGLE_TEST_SRC "demangle_test.cc")

absl_test(
TARGET
demangle_test
SOURCES
${DEMANGLE_TEST_SRC}
PUBLIC_LIBRARIES
absl_stacktrace absl_stack_consumption
)


# test leak_check_test
list(APPEND LEAK_CHECK_TEST_SRC "leak_check_test.cc")

Expand All @@ -90,4 +127,3 @@ absl_test(
PUBLIC_LIBRARIES
absl_leak_check
)

Loading

0 comments on commit dca2eb5

Please sign in to comment.