[M3devel] Modula-3/C interop in Date/Time?
Tony Hosking
hosking at cs.purdue.edu
Fri Apr 16 04:06:14 CEST 2010
Indeed! UNTRACED.
On 15 Apr 2010, at 18:44, Rodney M. Bates wrote:
> Since these pointer variables are initialized by
> C code and their referents are also provided by C code
> as global variables, shouldn't the type be untraced?
>
> I suppose that, since they don't point into the traced
> heap, the collector implementation we have would quietly
> ignore them as roots. But that's relying on implementation-
> dependent information.
>
> Also, if someone created a field of type Date.TimeZone,
> (or an array of them) in a traced-heap-allocated object,
> which is a perfectly legitimate thing to do, what would
> our collector do then?
>
>
>
> Jay K wrote:
>> Is this legal/correct?
>>
>>
>> Date.i3:
>> TYPE TimeZone <: REFANY;
>> VAR Local, UTC: TimeZone; (* granted, will maybe change these to extern *)
>>
>>
>> Date.m3:
>> REVEAL TimeZone = BRANDED "Date.TimeZone" REF INTEGER;
>>
>>
>> DatePosixC.c:
>> static const int Local = 0;
>> static const int UTC = 1;
>> extern const int const * const Date__Local = &Local;
>> extern const int const * const Date__UTC = &UTC;
>>
>>
>> - Jay
More information about the M3devel
mailing list