B – Development Documentation
Directory Layout:
libmallocvis/
├── 📁 crates/ # Rust workspace
│ ├── 📦 mallocvis_lib/ # Memory interception library
│ │ ├── src/
│ │ │ ├── lib.rs # Library entry point
│ │ │ ├── hook.rs # malloc/free hooks
│ │ │ ├── network.rs # Network transmission
│ │ │ ├── cache.rs # Local caching
│ │ │ └── ...
│ │ └── Cargo.toml
│ ├── 📦 mallocvis_server/ # Data processing server
│ │ ├── src/
│ │ │ ├── main.rs # Server entry point
│ │ │ ├── collector.rs # Data collection
│ │ │ ├── flamegraph.rs # Flame graph generation
│ │ │ └── ...
│ │ └── Cargo.toml
│ └── 📦 mallocvis_ui/ # Web frontend
│ ├── src/
│ │ ├── lib.rs # WASM entry point
│ │ ├── app.rs # Main application
│ │ ├── components/ # UI components
│ │ └── pages/ # Page components
│ ├── index.html
│ ├── Trunk.toml
│ └── Cargo.toml
├── 📁 examples/ # Example programs
├── 📁 tests/ # Integration tests
├── 📁 docs/ # Project documentation
├── Cargo.toml # Workspace configuration
├── Makefile # Build scripts
└── README.md
| Module | Responsibility | Key Files |
|---|---|---|
| mallocvis_lib | Memory interception and data collection | hook.rs, network.rs |
| mallocvis_server | Data processing and web service | collector.rs, server.rs |
| mallocvis_ui | Frontend visualization interface | app.rs, components/ |
For detailed information, just refer to the Makefile —it’s all quite straightforward.