From a78b0cbb0ea7308af37dad63a721e14ed93c9279 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Tue, 3 Nov 2026 07:28:41 +0000 Subject: module --- malloclab-handout/util/mm-implicit.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'malloclab-handout/util/mm-implicit.h') diff --git a/malloclab-handout/util/mm-implicit.h b/malloclab-handout/util/mm-implicit.h index 820310c..64b2eaa 100644 --- a/malloclab-handout/util/mm-implicit.h +++ b/malloclab-handout/util/mm-implicit.h @@ -69,7 +69,7 @@ void loggerln( std::format_string fmt, Args&&... args ) } template< class... Args > -void logger( std::format_string fmt, Args&&... args ) +inline void logger( std::format_string fmt, Args&&... args ) { #ifdef OV4_VERBOSE print(fmt, forward(args)...); @@ -78,7 +78,7 @@ void logger( std::format_string fmt, Args&&... args ) } -void print_list() +inline void print_list() { #ifdef OV4_VERBOSE logger("print_list: "); @@ -95,8 +95,17 @@ void print_list() #endif } -void sync_footer(size_t header) +inline void sync_footer(size_t header) { size_t footer = header + get_size(*(size_t*)header) - SIZE_T_SIZE; *(size_t*)footer = *(size_t*)header; +} + +inline size_t stat_pack(size_t size, bool alloc, bool prev_alloc) +{ + size_t status = 0; + set_size(status, size); + set_alloc(status, alloc); + set_prev_alloc(status, prev_alloc); + return status; } \ No newline at end of file -- cgit v1.3.1-4-g156e