Re: when GC is permitted Jim Blandy 08 Jan 2004 22:45 UTC

Tom Lord <xxxxxx@emf.net> writes:
>     > (BTW, Tom will be quite disappointed with what GCC's optimizer
>     > will do to Pika-style code; go and try it.)
>
> You need to be much more specific.

You made a post before discussing how this would be optimized:

      list2 (scheme_value answer,
             scheme_instance instance,
             scheme_value * a,
             scheme_value * b)
      {
	struct my_frame
        {
          scheme_value nil;
          scheme_value last_pair;
        } f;

        SCHEME_GCPRO (f);

        SCHEME_MAKE_NIL (&f.nil, instance);
        SCHEME_CONS (&f.last_pair, instance, b, &f.nil);
        SCHEME_CONS (answer, instance, a, &f.last_pair);

        SCHEME_GCUNPRO (my_frame);
      }

Maybe my comment should have swaggered less, but it's been my
experience that GCC is pretty conservative about optimizing memory
references.