mirror of
https://github.com/oven-sh/bun
synced 2026-02-12 20:09:04 +00:00
* Move `DebugThreadLock` to `bun.safety` * Enable in `ci_assert` builds, but store stack traces only in debug builds * Reduce size of struct by making optional field non-optional * Add `initLockedIfNonComptime` as a workaround for not being able to call `initLocked` in comptime contexts * Add `lockOrAssert` method to acquire the lock if unlocked, or else assert that the current thread acquired the lock * Add stack traces to `CriticalSection` and `AllocPtr` in debug builds * Make `MimallocArena.init` infallible * Make `MimallocArena.heap` non-nullable * Rename `RefCount.active_counts` to `raw_count` and provide read-only `get` method * Add `bun.safety.alloc.assertEq` to assert that two allocators are equal (avoiding comparison of undefined `ptr`s) (For internal tracking: fixes STAB-917, STAB-918, STAB-962, STAB-963, STAB-964, STAB-965) --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
17 lines
706 B
Zig
17 lines
706 B
Zig
//! The `ptr` module contains smart pointer types that are used throughout Bun.
|
|
pub const Cow = @import("./ptr/Cow.zig").Cow;
|
|
|
|
pub const CowSlice = @import("./ptr/CowSlice.zig").CowSlice;
|
|
pub const CowSliceZ = @import("./ptr/CowSlice.zig").CowSliceZ;
|
|
pub const CowString = CowSlice(u8);
|
|
|
|
pub const ref_count = @import("./ptr/ref_count.zig");
|
|
pub const RefCount = ref_count.RefCount;
|
|
pub const ThreadSafeRefCount = ref_count.ThreadSafeRefCount;
|
|
pub const RefPtr = ref_count.RefPtr;
|
|
|
|
pub const TaggedPointer = @import("./ptr/tagged_pointer.zig").TaggedPointer;
|
|
pub const TaggedPointerUnion = @import("./ptr/tagged_pointer.zig").TaggedPointerUnion;
|
|
|
|
pub const WeakPtr = @import("./ptr/weak_ptr.zig").WeakPtr;
|