MCPcopy Create free account

hub / github.com/abgros/stalloc / functions

Functions113 in github.com/abgros/stalloc

↓ 23 callersFunctionas_u16
(val: usize)
src/lib.rs:98
↓ 19 callersMethodacquire_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 callersMethodheader_at
Safety precondition: idx must be in `0..L`.
src/lib.rs:627
↓ 7 callersMethodallocate_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 callersMethoddeallocate_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 callersMethodclaims
(&self, ptr: *mut u8, layout: Layout)
src/lib.rs:877
↓ 4 callersMethodheader_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 callersFunctionheader_in_block
This function is always safe to call, as `ptr` is not dereferenced.
src/lib.rs:88
↓ 2 callersMethodallocate
(&self, layout: Layout)
src/lib.rs:700
↓ 2 callersMethodallocate
(&self, layout: Layout)
src/chain.rs:105
↓ 2 callersMethodblock_at
Safety precondition: idx must be in `0..L`.
src/lib.rs:621
↓ 2 callersMethoddeallocate
(&self, ptr: NonNull<u8>, layout: Layout)
src/chain.rs:111
↓ 2 callersMethodgrow_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 callersMethodindex_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 callersMethodis_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 callersMethodshrink_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 callersMethodalloc
(&self, layout: Layout)
src/unsafestalloc.rs:127
↓ 1 callersMethodalloc
(&self, layout: Layout)
src/chain.rs:49
↓ 1 callersMethodchain
Creates a new `AllocChain` containing this allocator and `next`.
src/lib.rs:889
↓ 1 callersMethodclear
# Safety Calling this function immediately invalidates all pointers into the allocator. Calling `deallocate_blocks()` with an invalidated pointer wil
src/lib.rs:231
↓ 1 callersMethoddealloc
(&self, ptr: *mut u8, layout: Layout)
src/chain.rs:58
↓ 1 callersMethodgrow
( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, )
src/lib.rs:739
↓ 1 callersMethodgrow
( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, )
src/chain.rs:119
Methodalloc
(&self, layout: Layout)
src/syncstalloc.rs:213
Methodalloc_zeroed
(&self, layout: Layout)
src/syncstalloc.rs:218
Methodalloc_zeroed
(&self, layout: Layout)
src/unsafestalloc.rs:139
Methodallocate
(&self, layout: Layout)
src/syncstalloc.rs:242
Methodallocate
(&self, layout: Layout)
src/unsafestalloc.rs:70
Methodallocate_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
Methodallocate_zeroed
(&self, layout: Layout)
src/lib.rs:717
Methodallocate_zeroed
(&self, layout: Layout)
src/syncstalloc.rs:253
Methodallocate_zeroed
(&self, layout: Layout)
src/unsafestalloc.rs:81
Methodby_ref
(&self)
src/syncstalloc.rs:287
Methodby_ref
(&self)
src/unsafestalloc.rs:115
Methodby_ref
(&self)
src/chain.rs:196
Methodchain
Creates a new `AllocChain` containing this allocator and `next`.
src/syncstalloc.rs:309
Methodchain
Creates a new `AllocChain` containing this allocator and `next`.
src/unsafestalloc.rs:215
Methodchain
Creates a new `AllocChain` containing this chain and `next`.
src/chain.rs:40
Methodclaims
(&self, ptr: *mut u8, layout: Layout)
src/syncstalloc.rs:299
Methodclaims
(&self, ptr: *mut u8, layout: Layout)
src/unsafestalloc.rs:205
Methodclear
# Safety Calling this function immediately invalidates all pointers into the allocator. Calling `deallocate_blocks()` with an invalidated pointer wil
src/syncstalloc.rs:84
Methoddealloc
(&self, ptr: *mut u8, layout: Layout)
src/syncstalloc.rs:223
Methoddealloc
(&self, ptr: *mut u8, layout: Layout)
src/unsafestalloc.rs:151
Methoddeallocate
(&self, ptr: NonNull<u8>, layout: Layout)
src/lib.rs:728
Methoddeallocate
(&self, ptr: NonNull<u8>, layout: Layout)
src/syncstalloc.rs:246
Methoddeallocate
(&self, ptr: NonNull<u8>, layout: Layout)
src/unsafestalloc.rs:74
Methoddeallocate_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
Methoddefault
()
src/lib.rs:689
Methoddefault
()
src/syncstalloc.rs:195
Methodderef
(&self)
src/syncstalloc.rs:39
Methodderef
(&self)
src/unsafestalloc.rs:25
Methodfmt
(&self, f: &mut Formatter)
src/lib.rs:657
Methodfmt
(&self, f: &mut Formatter<'_>)
src/syncstalloc.rs:204
Methodfmt
(&self, f: &mut Formatter<'_>)
src/unsafestalloc.rs:34
Methodfmt
(&self, f: &mut core::fmt::Formatter)
src/alloc.rs:15
Methodgrow
( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, )
src/syncstalloc.rs:257
Methodgrow
( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, )
src/unsafestalloc.rs:85
Functiongrow_from_1
()
src/tests.rs:270
Methodgrow_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
Methodgrow_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
Methodgrow_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
Methodgrow_zeroed
( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, )
src/lib.rs:788
Methodgrow_zeroed
( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, )
src/syncstalloc.rs:267
Methodgrow_zeroed
( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, )
src/unsafestalloc.rs:95
Methodgrow_zeroed
( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, )
src/chain.rs:147
Methodis_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
Methodis_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
Methodis_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
Functionmain
()
examples/threaded.rs:9
Functionmain
()
examples/chained.rs:11
Functionmain
()
examples/fast_vectors.rs:9
Functionmain
()
examples/local_string.rs:4
Functionmain
()
examples/local_alloc.rs:5
Methodnew
()
src/lib.rs:149
Methodnew
()
src/syncstalloc.rs:57
Methodnew
()
src/unsafestalloc.rs:55
Methodnew
Initializes a new `AllocChain`.
src/chain.rs:35
Methodrealloc
(&self, ptr: *mut u8, old_layout: Layout, new_size: usize)
src/syncstalloc.rs:228
Methodrealloc
(&self, ptr: *mut u8, old_layout: Layout, new_size: usize)
src/unsafestalloc.rs:160
Methodrealloc
(&self, ptr: *mut u8, layout: Layout, new_size: usize)
src/chain.rs:66
Functionself_referential
()
src/tests.rs:243
Functionself_referential_growing
()
src/tests.rs:257
Methodshrink
( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, )
src/lib.rs:809
Methodshrink
( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, )
src/syncstalloc.rs:277
Methodshrink
( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, )
src/unsafestalloc.rs:105
Methodshrink
( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, )
src/chain.rs:168
Methodshrink_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
Functiontest_2_vecs
()
src/tests.rs:23
Functiontest_boxes
()
src/tests.rs:232
Functiontest_boxes_vec_grow
()
src/tests.rs:369
Functiontest_claims
()
src/tests.rs:417
Functiontest_complex_alloc_and_free
()
src/tests.rs:104
Functiontest_differently_sized_vecs
()
src/tests.rs:36
Functiontest_free
()
src/tests.rs:74
Functiontest_free_and_realloc
()
src/tests.rs:88
Functiontest_grow
()
src/tests.rs:180
Functiontest_grow_and_free
()
src/tests.rs:280
Functiontest_grow_realloc
()
src/tests.rs:189
Functiontest_large_and_small_alloc
()
src/tests.rs:343
Functiontest_multiple_allocations_and_drops
()
src/tests.rs:200
next →1–100 of 113, ranked by callers