You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs.md
+5-4
Original file line number
Diff line number
Diff line change
@@ -293,7 +293,7 @@ When you need to unload modules `relib` provides memory deallocation, background
293
293
294
294
But `relib` can also be used without these features. For example, you probably don't want to reload modules in production since it can be dangerous.
295
295
296
-
Even without unloading `relib` provides some useful features: imports/exports, panic handling in exports, and some checks in module loading (see [`LoadError`](https://docs.rs/relib_host/latest/relib_host/enum.LoadError.html)).
296
+
Even without unloading `relib` provides some useful features: imports/exports, panic handling in exports, backtraces [support](#backtraces) for multiple modules (dynamic libraries), and some checks in module loading (see [`LoadError`](https://docs.rs/relib_host/latest/relib_host/enum.LoadError.html)).
297
297
298
298
### How to turn off module unloading
299
299
@@ -315,7 +315,7 @@ It's done using `#[global_allocator]` so if you want to set your own global allo
| Final unload check [(?)](#final-unload-check)| ✅ | ✅ |
317
317
| Before load check [(?)](#before-load-check)| ✅ | ✅ |
318
-
|mmap hooks [(?)](#mmap-hooks)| ✅ |Not needed|
318
+
|Backtraces [(?)](#backtraces)| ✅ |✅ |
319
319
320
320
### Memory deallocation
321
321
@@ -401,6 +401,7 @@ After host called `library.close()` ([`close`](https://docs.rs/libloading/latest
401
401
402
402
Before loading a module host checks if module is already loaded or not, if it's loaded [`ModuleAlreadyLoaded`](https://docs.rs/relib_host/latest/relib_host/enum.LoadError.html#variant.ModuleAlreadyLoaded) error will be returned.
403
403
404
-
### mmap hooks
404
+
### Backtraces
405
405
406
-
Hooks of libc `mmap64` and `munmap` to unmap leaked memory mappings on module unloading. It's needed for example to unmap leaked mappings in std [backtrace](https://github.com/xxshady/relib/issues/7).
406
+
On Linux there are hooks of libc `mmap64` and `munmap` to unmap leaked memory mappings on module unloading in `std::backtrace` since there is no public API for that.<br>
407
+
On Windows there is a `dbghelp.dll` hook, which is initialized in `relib_host::load_module` when it's called for the first time. It adds support for backtraces in multiple modules (even without [unloading](#usage-without-unloading) feature).
0 commit comments