2011/2/9 Hongwei Xi <hwxi@cs.bu.edu>
On Wed, 9 Feb 2011, Guillaume Brunerie wrote:

>>But you could use string_of_strbuf or string_of_strptr, why do you need to
>>cast with such unsafe functions?

string_of_strptr turns a strptr into a string, which can only be reclaimed
by the GC. If no GC is running, then it is a memory leak.

So there is no clean solution?
It seems that the problem comes from the fact that a constant string is given the type 'string' even if it will not be freed by the GC (because it’s a constant string in the data segment), and that constant strings are used even in a program without GC.
Perhaps that there should be a special type for constant strings?

Guillaume