Skip to content

Commit d02dd21

Browse files
authored
Make stats fields in esp alloc public (#3828)
* Update lib.rs * Update CHANGELOG.md * Update CHANGELOG.md
1 parent 8c64b09 commit d02dd21

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

esp-alloc/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212

1313
### Changed
14-
14+
- Make stats structs fields public (#3828)
1515

1616
### Fixed
1717

esp-alloc/src/lib.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -192,16 +192,16 @@ pub enum MemoryCapability {
192192
#[derive(Debug)]
193193
pub struct RegionStats {
194194
/// Total usable size of the heap region in bytes.
195-
size: usize,
195+
pub size: usize,
196196

197197
/// Currently used size of the heap region in bytes.
198-
used: usize,
198+
pub used: usize,
199199

200200
/// Free size of the heap region in bytes.
201-
free: usize,
201+
pub free: usize,
202202

203203
/// Capabilities of the memory region.
204-
capabilities: EnumSet<MemoryCapability>,
204+
pub capabilities: EnumSet<MemoryCapability>,
205205
}
206206

207207
impl Display for RegionStats {
@@ -302,25 +302,25 @@ impl HeapRegion {
302302
#[derive(Debug)]
303303
pub struct HeapStats {
304304
/// Granular stats for all the configured memory regions.
305-
region_stats: [Option<RegionStats>; 3],
305+
pub region_stats: [Option<RegionStats>; 3],
306306

307307
/// Total size of all combined heap regions in bytes.
308-
size: usize,
308+
pub size: usize,
309309

310310
/// Current usage of the heap across all configured regions in bytes.
311-
current_usage: usize,
311+
pub current_usage: usize,
312312

313313
/// Estimation of the max used heap in bytes.
314314
#[cfg(feature = "internal-heap-stats")]
315-
max_usage: usize,
315+
pub max_usage: usize,
316316

317317
/// Estimation of the total allocated bytes since initialization.
318318
#[cfg(feature = "internal-heap-stats")]
319-
total_allocated: usize,
319+
pub total_allocated: usize,
320320

321321
/// Estimation of the total freed bytes since initialization.
322322
#[cfg(feature = "internal-heap-stats")]
323-
total_freed: usize,
323+
pub total_freed: usize,
324324
}
325325

326326
impl Display for HeapStats {

0 commit comments

Comments
 (0)