|
@@ -77,7 +77,7 @@ void * alloc_memblock ( size_t size, size_t align ) {
|
77
|
77
|
*/
|
78
|
78
|
size = ( size + MIN_MEMBLOCK_SIZE - 1 ) & ~( MIN_MEMBLOCK_SIZE - 1 );
|
79
|
79
|
align_mask = ( align - 1 ) | ( MIN_MEMBLOCK_SIZE - 1 );
|
80
|
|
- DBG ( "Allocating %zx (aligned %zx)\n", size, align );
|
|
80
|
+ DBG ( "Allocating %#zx (aligned %#zx)\n", size, align );
|
81
|
81
|
|
82
|
82
|
/* Search through blocks for the first one with enough space */
|
83
|
83
|
list_for_each_entry ( block, &free_blocks, list ) {
|
|
@@ -92,7 +92,7 @@ void * alloc_memblock ( size_t size, size_t align ) {
|
92
|
92
|
pre = block;
|
93
|
93
|
block = ( ( ( void * ) pre ) + pre_size );
|
94
|
94
|
post = ( ( ( void * ) block ) + size );
|
95
|
|
- DBG ( "[%p,%p) -> [%p,%p) + [%p,%p)\n", pre,
|
|
95
|
+ DBG ( "[%p,%p) -> [%p,%p) + [%p,%p)\n", pre,
|
96
|
96
|
( ( ( void * ) pre ) + pre->size ), pre, block,
|
97
|
97
|
post, ( ( ( void * ) pre ) + pre->size ) );
|
98
|
98
|
/* If there is a "post" block, add it in to
|
|
@@ -124,7 +124,7 @@ void * alloc_memblock ( size_t size, size_t align ) {
|
124
|
124
|
}
|
125
|
125
|
}
|
126
|
126
|
|
127
|
|
- DBG ( "Failed to allocate %zx (aligned %zx)\n", size, align );
|
|
127
|
+ DBG ( "Failed to allocate %#zx (aligned %#zx)\n", size, align );
|
128
|
128
|
return NULL;
|
129
|
129
|
}
|
130
|
130
|
|
|
@@ -261,7 +261,7 @@ void mdumpfree ( void ) {
|
261
|
261
|
|
262
|
262
|
printf ( "Free block list:\n" );
|
263
|
263
|
list_for_each_entry ( block, &free_blocks, list ) {
|
264
|
|
- printf ( "[%p,%p] (size %zx)\n", block,
|
|
264
|
+ printf ( "[%p,%p] (size %#zx)\n", block,
|
265
|
265
|
( ( ( void * ) block ) + block->size ), block->size );
|
266
|
266
|
}
|
267
|
267
|
}
|