[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] RFC: misc NIO fixes

From: Archie Cobbs
Subject: Re: [cp-patches] RFC: misc NIO fixes
Date: Tue, 19 Jul 2005 09:12:43 -0500
User-agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.3) Gecko/20041129

Casey Marshall wrote:
Attached is a patch I'd like to get some comments on, before I check it in, especially if anyone can spot holes in my C. This patch

+  /* FIXME: I'd bet dollars for donuts the compiler optimizes this
+     away. How can we load memory into core??? */
+  for (i = 0; i < size; i += pagesize)
+    {
+      foo += ((int *) address)[i];
+    }

You can force the memory to be accessed e.g. like this:

  for (i = 0; ... )
     *((volatile int *)address + i;

Otherwise looks good after a quick scan.


Archie Cobbs      *        CTO, Awarix        *

reply via email to

[Prev in Thread] Current Thread [Next in Thread]