Jeff Clites <[EMAIL PROTECTED]> wrote:

> It should be possible to aggregate all of the constants into a single
> array (one include, rather than one-per-source-file), which would let
> us identify them by their memory location, as residing in this range.
> That seems pretty straightforward to do. So rather than compiling to
> static_string_532, instead _S("foo") would compile to
> static_strings[7], or something. Then the check is just whether
> (some_string >= static_strings[0] && some_string <=
> static_strings[max])--if so, it was from a literal (and thus, is
> constant).

The problem with this approach is that it's happening in the fast path
of C<pobject_lives()>. The compare of the memory addresses would be done
for *all* objects.

So I think, it's better to just allocate a string header in the constant
string header pool and treat these strings like those in the constant
table.

That still needs collecting all constant strings in one file plus the
creation of the constant string headers on interpreter startup.

> JEff

leo

Reply via email to