Added debug messages to initialisation functions, but getting a segfault.
Not going to debug that tonight!
This commit is contained in:
parent
f751fc8a09
commit
25c87aac6e
4 changed files with 29 additions and 1 deletions
|
|
@ -18,6 +18,7 @@
|
|||
#include <string.h>
|
||||
|
||||
#include "debug.h"
|
||||
|
||||
#include "memory/destroy.h"
|
||||
#include "memory/header.h"
|
||||
#include "memory/memory.h"
|
||||
|
|
@ -39,6 +40,10 @@
|
|||
struct pso_pointer allocate( char *tag, uint8_t size_class ) {
|
||||
struct pso_pointer result = nil;
|
||||
|
||||
#ifdef DEBUG
|
||||
debug_printf( DEBUG_ALLOC, 0, L"Allocating object of size class %d with tag `%s`... ", size_class, tag);
|
||||
#endif
|
||||
|
||||
if ( size_class <= MAX_SIZE_CLASS ) {
|
||||
if ( nilp( freelists[size_class] ) ) {
|
||||
result = allocate_page( size_class );
|
||||
|
|
@ -66,6 +71,10 @@ struct pso_pointer allocate( char *tag, uint8_t size_class ) {
|
|||
}
|
||||
} // TODO: else throw exception
|
||||
|
||||
#ifdef DEBUG
|
||||
debug_print(exceptionp(result)? L"fail\n" : L"success\n", DEBUG_ALLOC, 0);
|
||||
#endif
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue