1
0
Fork 0

Log assert_no_alloc failures using the logger

This can now finally be enabled thanks to NIH-log explicitly supporting
reentrant logging.

This finally resolves #30.
This commit is contained in:
Robbert van der Helm 2023-03-01 19:53:36 +01:00
parent e9ac1c9efd
commit 4ee5f13638
2 changed files with 2 additions and 7 deletions

1
Cargo.lock generated
View file

@ -177,6 +177,7 @@ version = "1.1.2"
source = "git+https://github.com/robbert-vdh/rust-assert-no-alloc.git?branch=nih-plug#95120d996240a2c279a6067502e11b62d30563a6" source = "git+https://github.com/robbert-vdh/rust-assert-no-alloc.git?branch=nih-plug#95120d996240a2c279a6067502e11b62d30563a6"
dependencies = [ dependencies = [
"backtrace", "backtrace",
"log",
] ]
[[package]] [[package]]

View file

@ -95,13 +95,7 @@ widestring = "1.0.0-beta.1"
# Used for the `assert_process_allocs` feature. This fork includes support for # Used for the `assert_process_allocs` feature. This fork includes support for
# the log crate and printing backtraces on allocation failure so you can trace # the log crate and printing backtraces on allocation failure so you can trace
# the allocation back to a place in the code. # the allocation back to a place in the code.
# TODO: The `log` feature causes would pipe these messages through our logger assert_no_alloc = { git = "https://github.com/robbert-vdh/rust-assert-no-alloc.git", branch = "nih-plug", features = ["backtrace", "log"], optional = true }
# which is great in theory, but if the allocation failure happens as part
# of the logger then this will cause the program to hang indefinitely
# because simplelog gates the log function behind a mutex. At some point
# we should implement our own logger and enable this feature. That way we
# can also use CLAP's logging extension.
assert_no_alloc = { git = "https://github.com/robbert-vdh/rust-assert-no-alloc.git", branch = "nih-plug", features = ["backtrace"], optional = true }
# Used for the `standalone` feature # Used for the `standalone` feature
# NOTE: OpenGL support is not needed here, but rust-analyzer gets confused when # NOTE: OpenGL support is not needed here, but rust-analyzer gets confused when