This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gh_symbol2scm


On 26 Oct 1999, Mark Galassi wrote:
>     Lynn> Q: Is there any reason that gh_symbol2scm(char *) isn't
>     Lynn> gh_symbol2scm(const char *)?
> 
> Not that I can think of.  I guess I'm old school, from before there
> were "const char *" declarations, so I never think of doing that.
> 
> Can the compiler optimize better it you tell it that the string will
> not be mutated?
> 
    It should be able to at least reduce space. I'm using a lot of
constant strings to create tagged lists, so I get a lot of warnings about
losing constness of the strings.  I would guess this prevents it from
collecting occurences of the same constant string and sticking it in a
code section of the object file.
    FWIW, I never think of doing it either, until I get compiler warnings.

Lynn



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]