Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/abgros/stalloc
/ functions
Functions
113 in github.com/abgros/stalloc
⨍
Functions
113
◇
Types & classes
11
↓ 23 callers
Function
as_u16
(val: usize)
src/lib.rs:98
↓ 19 callers
Method
acquire_locked
Acquires an exclusive lock for the allocator. This can be used to chain multiple operations on the allocator without having to repeatedly acquire lock
src/syncstalloc.rs:180
↓ 13 callers
Method
header_at
Safety precondition: idx must be in `0..L`.
src/lib.rs:627
↓ 7 callers
Method
allocate_blocks
Tries to allocate `count` blocks. If the allocation succeeds, a pointer is returned. This function never allocates more than necessary. Note that `ali
src/lib.rs:263
↓ 7 callers
Method
deallocate_blocks
Deallocates a pointer. This function always succeeds. # Safety `ptr` must point to an allocation, and `size` must be the number of blocks in the all
src/lib.rs:358
↓ 5 callers
Method
claims
(&self, ptr: *mut u8, layout: Layout)
src/lib.rs:877
↓ 4 callers
Method
header_before
This function always is safe to call. If `idx` is very large, the returned value will simply be the last header in the free list. Note: this function
src/lib.rs:634
↓ 3 callers
Function
header_in_block
This function is always safe to call, as `ptr` is not dereferenced.
src/lib.rs:88
↓ 2 callers
Method
allocate
(&self, layout: Layout)
src/lib.rs:700
↓ 2 callers
Method
allocate
(&self, layout: Layout)
src/chain.rs:105
↓ 2 callers
Method
block_at
Safety precondition: idx must be in `0..L`.
src/lib.rs:621
↓ 2 callers
Method
deallocate
(&self, ptr: NonNull<u8>, layout: Layout)
src/chain.rs:111
↓ 2 callers
Method
grow_in_place
Tries to grow the current allocation in-place. If that isn't possible, this function is a no-op. # Safety `ptr` must point to a valid allocation of
src/lib.rs:473
↓ 2 callers
Method
index_of
Get the index of a pointer to `data`. This function is always safe to call, but the result may not be meaningful. Even if the header is not at the sta
src/lib.rs:616
↓ 2 callers
Method
is_oom
Checks if the allocator is completely out of memory. If this is false, then you are guaranteed to be able to allocate a layout with a size and alignme
src/lib.rs:185
↓ 2 callers
Method
shrink_in_place
Shrinks the allocation. This function always succeeds and never reallocates. # Safety `ptr` must point to a valid allocation of `old_size` blocks, a
src/lib.rs:414
↓ 1 callers
Method
alloc
(&self, layout: Layout)
src/unsafestalloc.rs:127
↓ 1 callers
Method
alloc
(&self, layout: Layout)
src/chain.rs:49
↓ 1 callers
Method
chain
Creates a new `AllocChain` containing this allocator and `next`.
src/lib.rs:889
↓ 1 callers
Method
clear
# Safety Calling this function immediately invalidates all pointers into the allocator. Calling `deallocate_blocks()` with an invalidated pointer wil
src/lib.rs:231
↓ 1 callers
Method
dealloc
(&self, ptr: *mut u8, layout: Layout)
src/chain.rs:58
↓ 1 callers
Method
grow
( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, )
src/lib.rs:739
↓ 1 callers
Method
grow
( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, )
src/chain.rs:119
Method
alloc
(&self, layout: Layout)
src/syncstalloc.rs:213
Method
alloc_zeroed
(&self, layout: Layout)
src/syncstalloc.rs:218
Method
alloc_zeroed
(&self, layout: Layout)
src/unsafestalloc.rs:139
Method
allocate
(&self, layout: Layout)
src/syncstalloc.rs:242
Method
allocate
(&self, layout: Layout)
src/unsafestalloc.rs:70
Method
allocate_blocks
Tries to allocate `count` blocks. If the allocation succeed, a pointer is returned. This function never allocates more than necessary. # Safety `siz
src/syncstalloc.rs:99
Method
allocate_zeroed
(&self, layout: Layout)
src/lib.rs:717
Method
allocate_zeroed
(&self, layout: Layout)
src/syncstalloc.rs:253
Method
allocate_zeroed
(&self, layout: Layout)
src/unsafestalloc.rs:81
Method
by_ref
(&self)
src/syncstalloc.rs:287
Method
by_ref
(&self)
src/unsafestalloc.rs:115
Method
by_ref
(&self)
src/chain.rs:196
Method
chain
Creates a new `AllocChain` containing this allocator and `next`.
src/syncstalloc.rs:309
Method
chain
Creates a new `AllocChain` containing this allocator and `next`.
src/unsafestalloc.rs:215
Method
chain
Creates a new `AllocChain` containing this chain and `next`.
src/chain.rs:40
Method
claims
(&self, ptr: *mut u8, layout: Layout)
src/syncstalloc.rs:299
Method
claims
(&self, ptr: *mut u8, layout: Layout)
src/unsafestalloc.rs:205
Method
clear
# Safety Calling this function immediately invalidates all pointers into the allocator. Calling `deallocate_blocks()` with an invalidated pointer wil
src/syncstalloc.rs:84
Method
dealloc
(&self, ptr: *mut u8, layout: Layout)
src/syncstalloc.rs:223
Method
dealloc
(&self, ptr: *mut u8, layout: Layout)
src/unsafestalloc.rs:151
Method
deallocate
(&self, ptr: NonNull<u8>, layout: Layout)
src/lib.rs:728
Method
deallocate
(&self, ptr: NonNull<u8>, layout: Layout)
src/syncstalloc.rs:246
Method
deallocate
(&self, ptr: NonNull<u8>, layout: Layout)
src/unsafestalloc.rs:74
Method
deallocate_blocks
Deallocates a pointer. # Safety `ptr` must point to an allocation, and `size` must be the number of blocks in the allocation. That is, `size` is alw
src/syncstalloc.rs:114
Method
default
()
src/lib.rs:689
Method
default
()
src/syncstalloc.rs:195
Method
deref
(&self)
src/syncstalloc.rs:39
Method
deref
(&self)
src/unsafestalloc.rs:25
Method
fmt
(&self, f: &mut Formatter)
src/lib.rs:657
Method
fmt
(&self, f: &mut Formatter<'_>)
src/syncstalloc.rs:204
Method
fmt
(&self, f: &mut Formatter<'_>)
src/unsafestalloc.rs:34
Method
fmt
(&self, f: &mut core::fmt::Formatter)
src/alloc.rs:15
Method
grow
( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, )
src/syncstalloc.rs:257
Method
grow
( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, )
src/unsafestalloc.rs:85
Function
grow_from_1
()
src/tests.rs:270
Method
grow_in_place
Tries to grow the current allocation in-place. If that isn't possible, this function is a no-op. # Safety `ptr` must point to a valid allocation of
src/syncstalloc.rs:141
Method
grow_up_to
Tries to grow the current allocation in-place. If that isn't possible, the allocator grows by as much as it is able to, and the new length of the allo
src/lib.rs:556
Method
grow_up_to
Tries to grow the current allocation in-place. If that isn't possible, the allocator grows by as much as it is able to, and the new length of the allo
src/syncstalloc.rs:157
Method
grow_zeroed
( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, )
src/lib.rs:788
Method
grow_zeroed
( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, )
src/syncstalloc.rs:267
Method
grow_zeroed
( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, )
src/unsafestalloc.rs:95
Method
grow_zeroed
( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, )
src/chain.rs:147
Method
is_empty
Checks if the allocator is empty. If this is true, then you are guaranteed to be able to allocate a layout with a size of `B * L` bytes and an alignme
src/lib.rs:208
Method
is_empty
Checks if the allocator is empty. If this is true, then you are guaranteed to be able to allocate a layout with a size of `B * L` bytes and an alignme
src/syncstalloc.rs:76
Method
is_oom
Checks if the allocator is completely out of memory. If this is false, then you are guaranteed to be able to allocate a layout with a size and alignme
src/syncstalloc.rs:67
Function
main
()
examples/threaded.rs:9
Function
main
()
examples/chained.rs:11
Function
main
()
examples/fast_vectors.rs:9
Function
main
()
examples/local_string.rs:4
Function
main
()
examples/local_alloc.rs:5
Method
new
()
src/lib.rs:149
Method
new
()
src/syncstalloc.rs:57
Method
new
()
src/unsafestalloc.rs:55
Method
new
Initializes a new `AllocChain`.
src/chain.rs:35
Method
realloc
(&self, ptr: *mut u8, old_layout: Layout, new_size: usize)
src/syncstalloc.rs:228
Method
realloc
(&self, ptr: *mut u8, old_layout: Layout, new_size: usize)
src/unsafestalloc.rs:160
Method
realloc
(&self, ptr: *mut u8, layout: Layout, new_size: usize)
src/chain.rs:66
Function
self_referential
()
src/tests.rs:243
Function
self_referential_growing
()
src/tests.rs:257
Method
shrink
( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, )
src/lib.rs:809
Method
shrink
( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, )
src/syncstalloc.rs:277
Method
shrink
( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, )
src/unsafestalloc.rs:105
Method
shrink
( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, )
src/chain.rs:168
Method
shrink_in_place
Shrinks the allocation. This function always succeeds and never reallocates. # Safety `ptr` must point to a valid allocation of `old_size` blocks, a
src/syncstalloc.rs:124
Function
test_2_vecs
()
src/tests.rs:23
Function
test_boxes
()
src/tests.rs:232
Function
test_boxes_vec_grow
()
src/tests.rs:369
Function
test_claims
()
src/tests.rs:417
Function
test_complex_alloc_and_free
()
src/tests.rs:104
Function
test_differently_sized_vecs
()
src/tests.rs:36
Function
test_free
()
src/tests.rs:74
Function
test_free_and_realloc
()
src/tests.rs:88
Function
test_grow
()
src/tests.rs:180
Function
test_grow_and_free
()
src/tests.rs:280
Function
test_grow_realloc
()
src/tests.rs:189
Function
test_large_and_small_alloc
()
src/tests.rs:343
Function
test_multiple_allocations_and_drops
()
src/tests.rs:200
next →
1–100 of 113, ranked by callers