Generally, changed working with tags as strings to as values.

This seems both cheaper and safer; what's not to like?
This commit is contained in:
Simon Brooke 2021-08-17 16:09:00 +01:00
parent eadb125b83
commit 93d4bd14a0
No known key found for this signature in database
GPG key ID: A7A4F18D1D4DF987
17 changed files with 87 additions and 88 deletions

View file

@ -140,7 +140,7 @@ void free_cell( struct cons_pointer pointer ) {
debug_printf( DEBUG_ALLOC, L"Freeing cell " );
debug_dump_object( pointer, DEBUG_ALLOC );
if ( !check_tag( pointer, FREETAG ) ) {
if ( !check_tag( pointer, FREETV ) ) {
if ( cell->count == 0 ) {
switch ( cell->tag.value ) {
case CONSTV:
@ -209,7 +209,7 @@ void free_cell( struct cons_pointer pointer ) {
* return an exception. Which, as we cannot create such an exception when
* cons space is exhausted, means we must construct it at init time.
*/
struct cons_pointer allocate_cell( char *tag ) {
struct cons_pointer allocate_cell( uint32_t tag ) {
struct cons_pointer result = freelist;
@ -222,7 +222,7 @@ struct cons_pointer allocate_cell( char *tag ) {
if ( strncmp( &cell->tag.bytes[0], FREETAG, TAGLENGTH ) == 0 ) {
freelist = cell->payload.free.cdr;
strncpy( &cell->tag.bytes[0], tag, TAGLENGTH );
cell->tag.value = tag;
cell->count = 0;
cell->payload.cons.car = NIL;