Skip to content

Commit

Permalink
Deprecate abort_on_alloc_failure
Browse files Browse the repository at this point in the history
This config is unused and always true.

b/150410605
  • Loading branch information
kaidokert committed Mar 24, 2024
1 parent 494d0e9 commit 5035b0d
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 20 deletions.
1 change: 0 additions & 1 deletion cobalt/site/docs/reference/starboard/gn-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ Book: /youtube/cobalt/_book.yaml

| Variables |
| :--- |
| **`abort_on_allocation_failure`**<br><br> Halt execution on failure to allocate memory.<br><br>The default value is `true`. |
| **`asan_symbolizer_path`**<br><br> A symbolizer path for ASAN can be added to allow translation of callstacks.<br><br>The default value is `"<clang_base_path>/bin/llvm-symbolizer"`. |
| **`cobalt_licenses_platform`**<br><br> Sub-directory to copy license file to.<br><br>The default value is `"default"`. |
| **`cobalt_platform_dependencies`**<br><br> List of platform-specific targets that get compiled into cobalt.<br><br>The default value is `[]`. |
Expand Down
4 changes: 0 additions & 4 deletions starboard/build/config/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,6 @@ config("starboard") {
]
}

if (abort_on_allocation_failure) {
defines += [ "SB_ABORT_ON_ALLOCATION_FAILURE" ]
}

if (is_internal_build) {
defines += [ "INTERNAL_BUILD" ]
}
Expand Down
3 changes: 0 additions & 3 deletions starboard/build/config/base_configuration.gni
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ declare_args() {
starboard_level_gtest_target_type = "executable"
starboard_level_final_executable_type = "executable"

# Halt execution on failure to allocate memory.
abort_on_allocation_failure = true

# The source of EGL and GLES headers and libraries.
# Valid values (case and everything sensitive!):
# "none" - No EGL + GLES implementation is available on this platform.
Expand Down
12 changes: 0 additions & 12 deletions starboard/shared/starboard/memory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,27 +102,15 @@ void* SbMemoryAllocateChecked(size_t size) {
namespace {

inline void* SbMemoryAllocateImpl(size_t size) {
#if SB_ABORT_ON_ALLOCATION_FAILURE
return SbMemoryAllocateChecked(size);
#else
return SbMemoryAllocateUnchecked(size);
#endif
}

inline void* SbMemoryAllocateAlignedImpl(size_t alignment, size_t size) {
#if SB_ABORT_ON_ALLOCATION_FAILURE
return SbMemoryAllocateAlignedChecked(alignment, size);
#else
return SbMemoryAllocateAlignedUnchecked(alignment, size);
#endif
}

inline void* SbMemoryReallocateImpl(void* memory, size_t size) {
#if SB_ABORT_ON_ALLOCATION_FAILURE
return SbMemoryReallocateChecked(memory, size);
#else
return SbMemoryReallocateUnchecked(memory, size);
#endif
}

} // namespace
Expand Down

0 comments on commit 5035b0d

Please sign in to comment.