11[package ]
22name = " memapi"
3- # major will probably always be 0
4- version = " 0.14.3"
3+ version = " 0.15.0"
54edition = " 2018"
6- authors = [" echohumm" ]
7- readme = " README.md"
85rust-version = " 1.56.0"
6+ authors = [" echohumm" ]
97description = " A no_std-friendly memory allocation interface for raw buffers, with improved error reporting."
8+ readme = " README.md"
109license = " MIT OR Apache-2.0"
1110repository = " https://github.com/echohumm/memapi"
1211keywords = [" allocator" , " no_std" , " memory" , " allocation" ]
1312categories = [" no-std" , " memory-management" ]
1413exclude = [" /tests" , " /bin" , " testall.py" , " src/expanded" ]
14+ build = " build.rs"
1515
1616[package .metadata .docs .rs ]
1717features = [" full" ]
1818
1919[badges ]
20- maintenance = { status = " actively-developed" }
2120docsrs = { status = " passing" }
21+ maintenance = { status = " actively-developed" }
2222
23- # TODO: docs for features
23+ [profile .bench ]
24+ opt-level = 3
25+ lto = true
26+ codegen-units = 1
27+ debug = false
28+ overflow-checks = false
2429
2530[features ]
26- nightly = []
27- std = [" libc/std" ]
31+ default = [" c_str" , " extra_extra_const" ]
32+
33+ # msrv-changing features
34+ extra_const = []
35+ extra_extra_const = [" extra_const" ]
36+ c_str = []
2837
38+ # nightly support
39+ nightly = []
2940metadata = [" nightly" ]
3041sized_hierarchy = [" nightly" ]
3142clone_to_uninit = [" nightly" ]
3243specialization = [" nightly" ]
3344
34- extra_const = []
35- extra_extra_const = [" extra_const" ]
36- c_str = []
37-
3845all_nightly = [" metadata" , " sized_hierarchy" , " clone_to_uninit" , " specialization" ]
46+
3947default_nightly = [" metadata" , " clone_to_uninit" , " specialization" ]
4048
49+ # std support
50+ std = []
51+ std_with_libc = [" std" , " libc/std" ]
52+
53+ # main extensions
4154alloc_ext = []
4255alloc_slice = []
4356resize_in_place = []
4457
58+ # stats
4559stats = []
4660
61+ # external allocators
4762external_alloc = [" libc" ]
48-
4963jemalloc = [" memapi-jemalloc-sys" , " external_alloc" ]
5064jemalloc_in_place = [" jemalloc" , " resize_in_place" ]
51-
5265mimalloc = [" memapi-mimalloc-sys" , " external_alloc" ]
5366mimalloc_in_place = [" mimalloc" , " resize_in_place" ]
54-
5567external_allocs = [" jemalloc" , " mimalloc" ]
5668external_allocs_in_place = [" jemalloc_in_place" , " mimalloc_in_place" ]
5769
58- full_min = [
59- " alloc_slice" ,
60- " alloc_ext" ,
61- " stats" ,
62- ]
63-
64- full_min_std = [
65- " full_min" ,
66- " std" ,
67- ]
68-
70+ # bundles
71+ full_min = [" alloc_slice" , " alloc_ext" , " stats" ]
72+ full_min_std = [" full_min" , " std" ]
6973full_no_std_no_nightly = [
70- # new versions
7174 " c_str" ,
7275 " extra_extra_const" ,
73- # extern
7476 " external_allocs_in_place" ,
75-
7677 " full_min" ,
7778]
79+ full_no_nightly = [" std" , " full_no_std_no_nightly" ]
80+ full_no_std = [" all_nightly" , " full_no_std_no_nightly" ]
81+ full = [" full_no_nightly" , " full_no_std" ]
7882
79- full_no_nightly = [
80- " std" ,
81- " full_no_std_no_nightly"
82- ]
83-
84- full_no_std = [
85- " all_nightly" ,
86- " full_no_std_no_nightly" ,
87- ]
88-
89- full = [
90- " full_no_nightly" ,
91- " full_no_std"
83+ # jemalloc feature tweaks
84+ jemalloc_background_threads_runtime_support = [" memapi-jemalloc-sys/background_threads_runtime_support" ]
85+ jemalloc_background_threads = [
86+ " jemalloc_background_threads_runtime_support" ,
87+ " memapi-jemalloc-sys/background_threads" ,
9288]
89+ jemalloc_debug = [" memapi-jemalloc-sys/debug" ]
90+ jemalloc_default = [" jemalloc_background_threads_runtime_support" , " memapi-jemalloc-sys/default" ]
91+ jemalloc_disable_cache_oblivious = [" memapi-jemalloc-sys/disable_cache_oblivious" ]
92+ jemalloc_disable_initial_exec_tls = [" memapi-jemalloc-sys/disable_initial_exec_tls" ]
93+ jemalloc_profiling = [" memapi-jemalloc-sys/profiling" ]
94+ jemalloc_stats = [" memapi-jemalloc-sys/stats" ]
95+ jemalloc_unprefixed_malloc_on_supported_platforms = [" memapi-jemalloc-sys/unprefixed_malloc_on_supported_platforms" ]
9396
94- default = [" c_str" , " extra_extra_const" ]
95-
97+ # mimalloc variants
9698mimalloc_arena = [" memapi-mimalloc-sys/arena" ]
9799mimalloc_debug = [" memapi-mimalloc-sys/debug" ]
98100mimalloc_debug_in_debug = [" memapi-mimalloc-sys/debug_in_debug" ]
@@ -101,35 +103,19 @@ mimalloc_no_thp = ["memapi-mimalloc-sys/no_thp"]
101103mimalloc_override = [" memapi-mimalloc-sys/override" ]
102104mimalloc_secure = [" memapi-mimalloc-sys/secure" ]
103105
104- jemalloc_background_threads_runtime_support = [" memapi-jemalloc-sys/background_threads_runtime_support" ]
105- jemalloc_background_threads = [" jemalloc_background_threads_runtime_support" , " memapi-jemalloc-sys/background_threads" ]
106- jemalloc_debug = [" memapi-jemalloc-sys/debug" ]
107- jemalloc_default = [" jemalloc_background_threads_runtime_support" , " memapi-jemalloc-sys/default" ]
108- jemalloc_disable_cache_oblivious = [" memapi-jemalloc-sys/disable_cache_oblivious" ]
109- jemalloc_disable_initial_exec_tls = [" memapi-jemalloc-sys/disable_initial_exec_tls" ]
110- jemalloc_profiling = [" memapi-jemalloc-sys/profiling" ]
111- jemalloc_stats = [" memapi-jemalloc-sys/stats" ]
112- jemalloc_unprefixed_malloc_on_supported_platforms = [" memapi-jemalloc-sys/unprefixed_malloc_on_supported_platforms" ]
113-
114106[[test ]]
115107name = " base"
116108path = " tests/alloc.rs"
117109
110+ [[test ]]
111+ name = " dangerous"
112+ path = " tests/potential_ub.rs"
113+
118114[[test ]]
119115name = " ext"
120116path = " tests/alloc_ext.rs"
121117required-features = [" alloc_ext" ]
122118
123- [[test ]]
124- name = " slice"
125- path = " tests/alloc_slice.rs"
126- required-features = [" alloc_slice" ]
127-
128- [[test ]]
129- name = " stats"
130- path = " tests/stats.rs"
131- required-features = [" stats" , " std" ]
132-
133119[[test ]]
134120name = " jem"
135121path = " tests/jemalloc.rs"
@@ -141,10 +127,28 @@ path = "tests/mimalloc.rs"
141127required-features = [" mimalloc" ]
142128
143129[[test ]]
144- name = " dangerous"
145- path = " tests/potential_ub.rs"
130+ name = " slice"
131+ path = " tests/alloc_slice.rs"
132+ required-features = [" alloc_slice" ]
133+
134+ [[test ]]
135+ name = " stats"
136+ path = " tests/stats.rs"
137+ required-features = [" stats" , " std" ]
138+
139+ # if this crate is ever built with a version above msrv, it will stop compiling because of this.
140+ # darn you, Cargo.lock
141+ [dev-dependencies .criterion ]
142+ version = " ^0.4.0"
143+ default-features = false
144+
145+ [[bench ]]
146+ name = " bench"
147+ path = " benches/bench.rs"
148+ harness = false
149+ required-features = [" alloc_ext" ]
146150
147151[dependencies ]
148- libc = { version = " ^0.2" , optional = true , default-features = false }
152+ libc = { version = " ^0.2.0 " , optional = true , default-features = false }
149153memapi-jemalloc-sys = { version = " 0.1.1" , optional = true }
150154memapi-mimalloc-sys = { version = " 0.1.2" , optional = true , features = [" extended" ] }
0 commit comments