(Encoder fref_counter): New ivar for guaranteeing that forward

references have unique names.  Previous use of the MapTable count
for this purpose didn't work because we occasionally removed elements
from the table, and thus had aliased forward reference numbers.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1354 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Andrew McCallum 1996-04-12 21:13:12 +00:00
parent 4e25d2ffb4
commit a6084ea9ae
2 changed files with 8 additions and 6 deletions

View file

@ -56,9 +56,10 @@
/* xxx in_progress_table should actually be an NSHashTable, /* xxx in_progress_table should actually be an NSHashTable,
but we are working around a bug right now. */ but we are working around a bug right now. */
NSMapTable *in_progress_table; /* objects begun writing, but !finished */ NSMapTable *in_progress_table; /* objects begun writing, but !finished */
NSMapTable *object_2_xref; /* objects already written */ NSMapTable *object_2_xref; /* objects already written */
NSMapTable *object_2_fref; /* table of forward references */ NSMapTable *object_2_fref; /* table of forward references */
NSMapTable *const_ptr_2_xref; /* const pointers already written */ NSMapTable *const_ptr_2_xref; /* const pointers already written */
unsigned fref_counter; /* Keep track of unused fref numbers */
} }
- initForWritingToFile: (id <String>) filename; - initForWritingToFile: (id <String>) filename;

View file

@ -56,9 +56,10 @@
/* xxx in_progress_table should actually be an NSHashTable, /* xxx in_progress_table should actually be an NSHashTable,
but we are working around a bug right now. */ but we are working around a bug right now. */
NSMapTable *in_progress_table; /* objects begun writing, but !finished */ NSMapTable *in_progress_table; /* objects begun writing, but !finished */
NSMapTable *object_2_xref; /* objects already written */ NSMapTable *object_2_xref; /* objects already written */
NSMapTable *object_2_fref; /* table of forward references */ NSMapTable *object_2_fref; /* table of forward references */
NSMapTable *const_ptr_2_xref; /* const pointers already written */ NSMapTable *const_ptr_2_xref; /* const pointers already written */
unsigned fref_counter; /* Keep track of unused fref numbers */
} }
- initForWritingToFile: (id <String>) filename; - initForWritingToFile: (id <String>) filename;