Skip to content

Commit 457411a

Browse files
committed
simplify memory leak logging
1 parent 3e00364 commit 457411a

File tree

2 files changed

+10
-10
lines changed
  • src/allocator

2 files changed

+10
-10
lines changed

src/allocator/dedicated_block_allocator/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,14 @@ impl SubAllocator for DedicatedBlockAllocator {
104104
#[cfg(feature = "std")]
105105
{
106106
backtrace_info = format!(
107-
r#"
108-
backtrace: {}
109-
"#,
107+
",
108+
backtrace: {}",
110109
self.backtrace
111110
)
112111
}
113112
#[cfg(not(feature = "std"))]
114113
{
115-
backtrace_info = "".to_owned()
114+
backtrace_info = ""
116115
}
117116

118117
log!(
@@ -122,7 +121,8 @@ impl SubAllocator for DedicatedBlockAllocator {
122121
memory block: {}
123122
dedicated allocation: {{
124123
size: 0x{:x},
125-
name: {},{backtrace_info}}}
124+
name: {}{backtrace_info}
125+
}}
126126
}}"#,
127127
memory_type_index,
128128
memory_block_index,

src/allocator/free_list_allocator/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -383,15 +383,14 @@ impl SubAllocator for FreeListAllocator {
383383
#[cfg(feature = "std")]
384384
{
385385
backtrace_info = format!(
386-
r#"
387-
backtrace: {}
388-
"#,
386+
",
387+
backtrace: {}",
389388
chunk.backtrace
390389
)
391390
}
392391
#[cfg(not(feature = "std"))]
393392
{
394-
backtrace_info = "".to_owned()
393+
backtrace_info = ""
395394
}
396395
log!(
397396
log_level,
@@ -403,7 +402,8 @@ impl SubAllocator for FreeListAllocator {
403402
size: 0x{:x},
404403
offset: 0x{:x},
405404
allocation_type: {:?},
406-
name: {},{backtrace_info}}}
405+
name: {}{backtrace_info}
406+
}}
407407
}}"#,
408408
memory_type_index,
409409
memory_block_index,

0 commit comments

Comments
 (0)