Not much progess. Priority has to be in fixing debug_printf.
This commit is contained in:
parent
aa0d60bbed
commit
dd4176e20b
3 changed files with 13 additions and 8 deletions
|
|
@ -109,8 +109,11 @@ struct pso_pointer pop_freelist( uint8_t size_class ) {
|
||||||
* on the freelist, but again we should sanity check. */
|
* on the freelist, but again we should sanity check. */
|
||||||
if ( object->header.count != 0 ) {
|
if ( object->header.count != 0 ) {
|
||||||
fwprintf( stderr,
|
fwprintf( stderr,
|
||||||
L"WARNING: Request to allocate object of size class %d, which is not implemented",
|
L"WARNING: Count of %d in newly allocated object at %d, %d, should be 0\n",
|
||||||
size_class );
|
result.page,
|
||||||
|
result.offset,
|
||||||
|
object->header.count );
|
||||||
|
object->header.count = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // TODO: else throw exception
|
} // TODO: else throw exception
|
||||||
|
|
|
||||||
|
|
@ -86,8 +86,14 @@ struct pso_pointer allocate( struct pso_pointer frame_pointer, char *tag,
|
||||||
struct pso_pointer result = pop_freelist( size_class );
|
struct pso_pointer result = pop_freelist( size_class );
|
||||||
struct pso4 *frame = pointer_to_pso4( frame_pointer );
|
struct pso4 *frame = pointer_to_pso4( frame_pointer );
|
||||||
|
|
||||||
|
if ( memory_initialised && c_nilp(frame_pointer)) {
|
||||||
|
fputws( L"WARNING: No stack frame passed to `allocate`.\n",
|
||||||
|
stderr );
|
||||||
|
}
|
||||||
|
|
||||||
if ( !c_nilp( result ) ) {
|
if ( !c_nilp( result ) ) {
|
||||||
strncpy( ( char * ) ( pointer_to_object( result )->header.tag.bytes.
|
struct pso2 *obj = pointer_to_object(result);
|
||||||
|
strncpy((char*) (obj->header.tag.bytes.
|
||||||
mnemonic ), tag, TAGLENGTH );
|
mnemonic ), tag, TAGLENGTH );
|
||||||
|
|
||||||
debug_printf( DEBUG_ALLOC, 0, L"at page %d, offset %d... ",
|
debug_printf( DEBUG_ALLOC, 0, L"at page %d, offset %d... ",
|
||||||
|
|
@ -100,10 +106,6 @@ struct pso_pointer allocate( struct pso_pointer frame_pointer, char *tag,
|
||||||
payload.stack_frame.
|
payload.stack_frame.
|
||||||
locals );
|
locals );
|
||||||
frame->payload.stack_frame.locals = locals;
|
frame->payload.stack_frame.locals = locals;
|
||||||
|
|
||||||
} else if ( memory_initialised ) {
|
|
||||||
fputws( L"WARNING: No stack frame passed to `allocate`.\n",
|
|
||||||
stderr );
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// TODO: throw exception
|
// TODO: throw exception
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ struct pso_pointer fetch_arg( struct pso4 *frame, unsigned int index ) {
|
||||||
struct pso_pointer result = nil;
|
struct pso_pointer result = nil;
|
||||||
|
|
||||||
// TODO check that the frame is indeed a frame!
|
// TODO check that the frame is indeed a frame!
|
||||||
if ( index < args_in_frame ) {
|
if ( index < frame->payload.stack_frame.args ) {
|
||||||
result = frame->payload.stack_frame.arg[index];
|
result = frame->payload.stack_frame.arg[index];
|
||||||
} else {
|
} else {
|
||||||
struct pso_pointer p = frame->payload.stack_frame.more;
|
struct pso_pointer p = frame->payload.stack_frame.more;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue