This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GTY and const


Geoffrey Keating <geoffk@geoffk.org> writes:

>> > Would it be better to add a cast around the assignment or to make
>> > the GTY code handle const members?
>> 
>> I'd prefer that you improved gengtype.
>
> It's not gengtype, the problem really is that you cannot have const
> GCed memory, for the same underlying reasons that you cannot free() a
> const pointer.

No, that's just plain not true.  cpplib makes extensive use of 'const'
to indicate write-once data structures (they are initialized through a
non-const pointer, of course).  Those definitely can be GC memory.

zw


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