Printing of bignums basically done, not tested.

This commit is contained in:
Simon Brooke 2018-12-29 23:44:28 +00:00
parent 342f0308d3
commit 489f008044
14 changed files with 244 additions and 164 deletions

View file

@ -151,7 +151,7 @@ void free_cell( struct cons_pointer pointer ) {
dec_ref( cell->payload.function.source );
break;
case INTEGERTV:
dec_ref( cell->payload.integer.more);
dec_ref( cell->payload.integer.more );
break;
case LAMBDATV:
case NLAMBDATV:
@ -179,8 +179,8 @@ void free_cell( struct cons_pointer pointer ) {
switch ( vso->header.tag.value ) {
case STACKFRAMETV:
free_stack_frame(get_stack_frame(pointer));
break;
free_stack_frame( get_stack_frame( pointer ) );
break;
}
free( ( void * ) cell->payload.vectorp.address );

View file

@ -103,10 +103,10 @@ void dump_object( FILE * output, struct cons_pointer pointer ) {
case RATIOTV:
fwprintf( output,
L"\t\tRational cell: value %ld/%ld, count %u\n",
pointer2cell( cell.payload.ratio.dividend ).payload.
integer.value,
pointer2cell( cell.payload.ratio.divisor ).payload.
integer.value, cell.count );
pointer2cell( cell.payload.ratio.dividend ).
payload.integer.value,
pointer2cell( cell.payload.ratio.divisor ).
payload.integer.value, cell.count );
break;
case READTV:
fwprintf( output, L"\t\tInput stream\n" );

View file

@ -222,14 +222,14 @@ void free_stack_frame( struct stack_frame *frame ) {
/*
* TODO: later, push it back on the stack-frame freelist
*/
debug_print(L"Entering free_stack_frame\n", DEBUG_ALLOC);
debug_print( L"Entering free_stack_frame\n", DEBUG_ALLOC );
for ( int i = 0; i < args_in_frame; i++ ) {
dec_ref( frame->arg[i] );
}
if ( !nilp( frame->more ) ) {
dec_ref( frame->more );
}
debug_print(L"Leaving free_stack_frame\n", DEBUG_ALLOC);
debug_print( L"Leaving free_stack_frame\n", DEBUG_ALLOC );
}

View file

@ -67,7 +67,7 @@ struct cons_pointer make_vso( char *tag, uint64_t payload_size ) {
struct vector_space_object *vso = malloc( padded );
if ( vso != NULL ) {
memset(vso, 0, padded);
memset( vso, 0, padded );
debug_printf( DEBUG_ALLOC,
L"make_vso: about to write tag '%s' into vso at %p\n",
tag, vso );