Hi,

Dag Sverre Seljebotn wrote:
> You once mentioned splitting up long 
> char literals for MSVC, was this ever done?

No. The problem was only with docstrings at the time, and they are commonly
put into a struct field instead of a string constant. So splitting them up
would have required a separate machinery from what we currently have for
Python string building.

This should be doable for Python strings, though, after a major cleanup in
string constant handling (which you are up to, it seems).


>>> One could argue that the literal can be reused -- however the C compiler 
>>> will in most (all?) cases optimize/collapse identical string constants
>> I doubt that it will do that in many cases. It can really only do that for
>> a const char*. All other char sequences are free to be mutated in place.
> 
> are you sure? The way I 
> understood it, all literals are "const char*", it's just that they can 
> be immediately assigned to a regular char* variable.

What I meant was: the current code doesn't allow this, as we only use char*
variables. If we can put them directly into the struct as a const char* and
then read them from there only inside the Python string building function,
that would allow the C compiler to merge them.

However, this still shouldn't apply to C strings, where merging them might
break user code.

Stefan

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to