Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 5db67bb

Browse files
committedFeb 7, 2025·
update docs
1 parent 2be598a commit 5db67bb

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
 

‎docs.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ When you need to unload modules `relib` provides memory deallocation, background
293293

294294
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.
295295

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)).
297297

298298
### How to turn off module unloading
299299

@@ -315,7 +315,7 @@ It's done using `#[global_allocator]` so if you want to set your own global allo
315315
| Background threads check [(?)](#background-threads-check) |||
316316
| Final unload check [(?)](#final-unload-check) |||
317317
| Before load check [(?)](#before-load-check) |||
318-
| mmap hooks [(?)](#mmap-hooks) || Not needed |
318+
| Backtraces [(?)](#backtraces) || |
319319

320320
### Memory deallocation
321321

@@ -401,6 +401,7 @@ After host called `library.close()` ([`close`](https://docs.rs/libloading/latest
401401

402402
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.
403403

404-
### mmap hooks
404+
### Backtraces
405405

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

Comments
 (0)
Please sign in to comment.