Crates.io | tetsy-util-mem |
lib.rs | tetsy-util-mem |
version | 0.9.1 |
source | src |
created_at | 2021-02-18 13:15:06.740306 |
updated_at | 2021-06-08 02:49:41.957888 |
description | Collection of tetsy memory related utilities |
homepage | |
repository | https://github.com/tetcoin/tetsy-common |
max_upload_size | |
id | 357043 |
size | 50,177 |
Collection of memory related utilities.
When tetsy-util-mem
is used as a dependency with any of the global allocator features enabled,
it must be the sole place where a global allocator is defined.
The only exception to this rule is when used in a no_std
context or when the estimate-heapsize
feature is used.
Because of that, it must be present in the dependency tree with a single version.
Starting from version 0.6.1, having duplicate versions of tetsy-util-mem
will lead
to a compile-time error. It still will be possible to have 0.5 and 0.6.1 versions in the same binary though.
Unless heeded you risk UB; see discussion in issue 364.
size_of
or size_of_val
.Others features define global allocator, see src/alloc.rs
.
This crate groups common dependency, a patched copy of unpublished malloc_size_of
from servo project is copied and partially reexported.
Malloc_size_of
code is used internally as a module with a few modification to be able to implement type locally.
For existing code using deprecated HeapsizeOf
crate, calls to heapsize_of_children
should be replace by calls to size_of
.