aboutsummaryrefslogtreecommitdiff
path: root/malloclab-handout/util
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-11-03 07:28:41 +0000
committer_ov4 <ov4@ov4.org>2026-11-03 07:28:41 +0000
commita78b0cbb0ea7308af37dad63a721e14ed93c9279 (patch)
treeac99128e96ce7db4aa1452331977b3abc9a0f55e /malloclab-handout/util
parentc0eceda8b0e7d120c2facc595730921280846f67 (diff)
module
Diffstat (limited to 'malloclab-handout/util')
-rw-r--r--malloclab-handout/util/mm-implicit.h15
1 files changed, 12 insertions, 3 deletions
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<Args...> fmt, Args&&... args )
}
template< class... Args >
-void logger( std::format_string<Args...> fmt, Args&&... args )
+inline void logger( std::format_string<Args...> fmt, Args&&... args )
{
#ifdef OV4_VERBOSE
print(fmt, forward<Args>(args)...);
@@ -78,7 +78,7 @@ void logger( std::format_string<Args...> 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