[M3devel] "target specific pragmas"?

Jay jayk123 at hotmail.com
Fri Feb 15 16:18:11 CET 2008


I don't know but I could easily see pointer arithmetic banned on pointers to garbage collected types.
I do NOT assume existing code will get garbage collection without source change.
But then again, what does the Boehm collector do?
 
And if I write:
 
a: array of integer;
for i := 0 to last(a) do (* or last - 1? Modula-3 array bounds not what I'm used to...*)
    IO.PutInt(a[i]);
end
 
in Modula-3, is the codegen a) really banned from and b) really avoids
"rewriting" that with pointer arithmetic?
 
I realize pointer arithmetic isn't even ever?often?usually?sometimes profitable these days i.e.:
 
unsigned array[n];
for (size_t i = 0 ; i != n ; ++i)
{   printf("%u\n", array[i]);
}
 
vs.
unsigned array[n];
for (unsigned* p = array ; p != (array + n) ; ++p)
{
  printf("%u\n", *p);
}
 
compilers can often do better with the first. I've heard this. I don't know why.
 
 - Jay



> Date: Fri, 15 Feb 2008 09:20:42 -0500> From: hendrik at topoi.pooq.com> To: m3devel at elegosoft.com> Subject: Re: [M3devel] "target specific pragmas"?> > On Thu, Feb 14, 2008 at 06:06:48PM -0500, Tony Hosking wrote:> > PS The C++ standard committee is actively developing the next C++ > > standard to include garbage collection as part of the spec.> > What are they ever going to do with those autodecremented pointers into > the middle of arrays?> > -- hendrik
_________________________________________________________________
Helping your favorite cause is as easy as instant messaging. You IM, we give.
http://im.live.com/Messenger/IM/Home/?source=text_hotmail_join
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20080215/9b42dc5c/attachment-0002.html>


More information about the M3devel mailing list