Print is less badly broken. Read is less badly broken. GC is too aggressive.
This commit is contained in:
parent
22b0160a26
commit
63906fe817
19 changed files with 489 additions and 303 deletions
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "debug.h"
|
||||
#include "memory/node.h"
|
||||
#include "memory/pointer.h"
|
||||
#include "memory/pso2.h"
|
||||
|
|
@ -40,15 +41,31 @@ struct pso_pointer search( struct pso_pointer key,
|
|||
struct pso_pointer result = nil;
|
||||
bool found = false;
|
||||
|
||||
#ifdef DEBUG
|
||||
debug_print( L"In search; key is: ", DEBUG_BIND, 0 );
|
||||
debug_print_object( key, DEBUG_BIND, 0 );
|
||||
debug_println( DEBUG_BIND );
|
||||
#endif
|
||||
|
||||
if ( consp( store ) ) {
|
||||
for ( struct pso_pointer cursor = store;
|
||||
consp( cursor ) && found == false; cursor = c_cdr( cursor ) ) {
|
||||
struct pso_pointer pair = c_car( cursor );
|
||||
#ifdef DEBUG
|
||||
debug_print( L"Checking ", DEBUG_BIND, 2 );
|
||||
debug_print_object( pair, DEBUG_BIND, 0 );
|
||||
#endif
|
||||
|
||||
if ( consp( pair ) && c_equal( c_car( pair ), key ) ) {
|
||||
found = true;
|
||||
result = return_key ? c_car( pair ) : c_cdr( pair );
|
||||
#ifdef DEBUG
|
||||
debug_print( L" ...found!", DEBUG_BIND, 0 );
|
||||
#endif
|
||||
}
|
||||
#ifdef DEBUG
|
||||
debug_println( DEBUG_BIND );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue