Hashmaps now *mostly* work

This commit is contained in:
Simon Brooke 2021-08-16 23:23:03 +01:00
parent 4fc9545be8
commit eadb125b83
No known key found for this signature in database
GPG key ID: A7A4F18D1D4DF987
10 changed files with 238 additions and 186 deletions

View file

@ -119,11 +119,11 @@ struct cons_pointer make_vso( char *tag, uint64_t payload_size ) {
* object. Dangerous! */
void free_vso( struct cons_pointer pointer ) {
struct cons_space_object * cell = &pointer2cell( pointer);
struct cons_space_object cell = pointer2cell( pointer );
debug_printf( DEBUG_ALLOC, L"About to free vector-space object at 0x%lx\n",
cell->payload.vectorp.address );
struct vector_space_object *vso = cell->payload.vectorp.address;
cell.payload.vectorp.address );
struct vector_space_object *vso = cell.payload.vectorp.address;
switch ( vso->header.tag.value ) {
case HASHTV:
@ -134,7 +134,18 @@ void free_vso( struct cons_pointer pointer ) {
break;
}
free( (void *)cell->payload.vectorp.address );
// free( (void *)cell.payload.vectorp.address );
debug_printf( DEBUG_ALLOC, L"Freed vector-space object at 0x%lx\n",
cell->payload.vectorp.address );
}
cell.payload.vectorp.address );
}
// bool check_vso_tag( struct cons_pointer pointer, char * tag) {
// bool result = false;
// if (check_tag(pointer, VECTORPOINTTAG)) {
// struct vector_space_object * vso = pointer_to_vso(pointer);
// result = strncmp( vso->header.tag.bytes[0], tag, TAGLENGTH);
// }
// return result;
// }