Skip to content

Commit 9e8dddb

Browse files
authored
Add custom allocator feature (#175)
1 parent de9c90d commit 9e8dddb

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

lvgl/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ nightly = []
7373
# function before constructing or using anything LVGL-related.
7474
unsafe_no_autoinit = []
7575

76+
# This feature is required to use the custom allocator in lvgl (`LV_MEM_CUSTOM=1` in `lv_conf.h`).
77+
custom_allocator = []
78+
7679
[build-dependencies]
7780
quote = "1.0.23"
7881
proc-macro2 = "1.0.51"

lvgl/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ pub fn init() {
9797
///
9898
/// After calling, ensure existing LVGL-related values are not accessed even if
9999
/// LVGL is reinitialized.
100+
#[cfg(not(feature = "custom_allocator"))]
100101
pub unsafe fn deinit() {
101102
unsafe {
102103
if IS_INIT {

0 commit comments

Comments
 (0)