At 2:19 PM +0200 10/25/03, Leopold Toetsch wrote:
Currently there is no simple way, to packout a Key that has number or string key members. PackFile_Constant_pack() for PFC_KEY does a linear lookup (find_in_const) to get at the index of the string or number in the constant table. This is really ugly.

I'd always assumed that key constants, when being reconstituted from the bytecode files, would just get strings built for them. Going with the constant table offset works, but it has the issue of not being able to pass keys across bytecode segments and needing entries made in the constant tables for dynamically created keys.


This all is also related with the discussion of constant PMCs/STRINGs, we had some time ago "[RfC] constant PMCs and classes" and with the lack of "get_string_keyed_str" and friends for hash lookup.

The lack of the string keyed variant is on purpose. Or, rather, the _int variant was a fast optimization put in to drop the overhead for array lookup. My assumption was, at the time, that hash lookups were expensive enough that there wasn't enough win in a shortcut to justify the extra space in all the vtables.
--
Dan


--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to