Skip to content

Commit

Permalink
move BunExtras.h to BunStdExtras.h
Browse files Browse the repository at this point in the history
  • Loading branch information
dylan-conway committed Nov 22, 2024
1 parent 5e0e669 commit 2195613
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 37 deletions.
1 change: 1 addition & 0 deletions Source/WTF/wtf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ set(WTF_PUBLIC_HEADERS
StdFilesystem.h
StdIntExtras.h
StdLibExtras.h
BunStdExtras.h
StdList.h
StdMap.h
StdMultimap.h
Expand Down
16 changes: 1 addition & 15 deletions Source/WTF/wtf/StdLibExtras.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,10 @@
#include <wtf/IterationStatus.h>
#include <wtf/TypeCasts.h>
#include <wtf/TypeTraits.h>
#include <bit>
#include <wtf/BunStdExtras.h>

WTF_ALLOW_UNSAFE_BUFFER_USAGE_BEGIN

#if defined(__cpp_lib_bit_cast) && __cpp_lib_bit_cast >= 201806L
#define __bit_cast std::bit_cast
#else
template <
typename Dest, typename Source,
typename std::enable_if<sizeof(Dest) == sizeof(Source) &&
std::is_trivially_copyable<Source>::value &&
std::is_trivially_copyable<Dest>::value,
int>::type = 0>
inline constexpr Dest __bit_cast(const Source &source) {
return __builtin_bit_cast(Dest, source);
}
#endif

#define SINGLE_ARG(...) __VA_ARGS__ // useful when a macro argument includes a comma

// Use this macro to declare and define a debug-only global variable that may have a
Expand Down
1 change: 0 additions & 1 deletion Source/bmalloc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ set(bmalloc_PUBLIC_HEADERS
bmalloc/Zone.h
bmalloc/bmalloc.h
bmalloc/valgrind.h
bmalloc/BunExtras.h

libpas/src/libpas/bmalloc_heap_config.h
libpas/src/libpas/bmalloc_heap.h
Expand Down
17 changes: 0 additions & 17 deletions Source/bmalloc/bmalloc/BunExtras.h

This file was deleted.

2 changes: 1 addition & 1 deletion Source/bmalloc/bmalloc/GigacageConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#include "Algorithm.h"
#include "GigacageKind.h"
#include "BunExtras.h"
#include "<wtf/BunStdExtras.h>"
#include <bit>
#include <inttypes.h>

Expand Down
2 changes: 1 addition & 1 deletion Source/bmalloc/bmalloc/IsoHeapImplInlines.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "IsoTLSDeallocatorEntry.h"
#include "IsoSharedHeapInlines.h"
#include "IsoSharedPageInlines.h"
#include "BunExtras.h"
#include "<wtf/BunStdExtras.h>"

#if !BUSE(LIBPAS)

Expand Down
2 changes: 1 addition & 1 deletion Source/bmalloc/bmalloc/IsoPageInlines.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include "IsoHeapImpl.h"
#include "IsoPage.h"
#include "VMAllocate.h"
#include "BunExtras.h"
#include "<wtf/BunStdExtras.h>"
#include <bit>

#if !BUSE(LIBPAS)
Expand Down
2 changes: 1 addition & 1 deletion Source/bmalloc/bmalloc/Packed.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#pragma once

#include "Algorithm.h"
#include "BunExtras.h"
#include "<wtf/BunStdExtras.h>"
#include <array>
#include <bit>

Expand Down

0 comments on commit 2195613

Please sign in to comment.