Make stats fields in esp alloc public (#3828)

* Update lib.rs

* Update CHANGELOG.md

* Update CHANGELOG.md
This commit is contained in:
Szybet 2025-07-18 14:44:55 +02:00 committed by GitHub
parent 8c64b09ba7
commit d02dd21871
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 11 deletions

View File

@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- Make stats structs fields public (#3828)
### Fixed ### Fixed

View File

@ -192,16 +192,16 @@ pub enum MemoryCapability {
#[derive(Debug)] #[derive(Debug)]
pub struct RegionStats { pub struct RegionStats {
/// Total usable size of the heap region in bytes. /// Total usable size of the heap region in bytes.
size: usize, pub size: usize,
/// Currently used size of the heap region in bytes. /// Currently used size of the heap region in bytes.
used: usize, pub used: usize,
/// Free size of the heap region in bytes. /// Free size of the heap region in bytes.
free: usize, pub free: usize,
/// Capabilities of the memory region. /// Capabilities of the memory region.
capabilities: EnumSet<MemoryCapability>, pub capabilities: EnumSet<MemoryCapability>,
} }
impl Display for RegionStats { impl Display for RegionStats {
@ -302,25 +302,25 @@ impl HeapRegion {
#[derive(Debug)] #[derive(Debug)]
pub struct HeapStats { pub struct HeapStats {
/// Granular stats for all the configured memory regions. /// Granular stats for all the configured memory regions.
region_stats: [Option<RegionStats>; 3], pub region_stats: [Option<RegionStats>; 3],
/// Total size of all combined heap regions in bytes. /// Total size of all combined heap regions in bytes.
size: usize, pub size: usize,
/// Current usage of the heap across all configured regions in bytes. /// Current usage of the heap across all configured regions in bytes.
current_usage: usize, pub current_usage: usize,
/// Estimation of the max used heap in bytes. /// Estimation of the max used heap in bytes.
#[cfg(feature = "internal-heap-stats")] #[cfg(feature = "internal-heap-stats")]
max_usage: usize, pub max_usage: usize,
/// Estimation of the total allocated bytes since initialization. /// Estimation of the total allocated bytes since initialization.
#[cfg(feature = "internal-heap-stats")] #[cfg(feature = "internal-heap-stats")]
total_allocated: usize, pub total_allocated: usize,
/// Estimation of the total freed bytes since initialization. /// Estimation of the total freed bytes since initialization.
#[cfg(feature = "internal-heap-stats")] #[cfg(feature = "internal-heap-stats")]
total_freed: usize, pub total_freed: usize,
} }
impl Display for HeapStats { impl Display for HeapStats {