[M3devel] Modula-3/C interop in Date/Time?

Rodney M. Bates rodney_bates at lcwb.coop
Fri Apr 16 00:44:07 CEST 2010


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