classpath-patches
[Top][All Lists]
Advanced

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

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


From: Casey Marshall
Subject: Re: [cp-patches] RFC: misc NIO fixes
Date: Thu, 21 Jul 2005 21:26:53 -0700

On Jul 21, 2005, at 3:04 PM, Mark Wielaard wrote:


Hi,

On Tue, 2005-07-19 at 09:12 -0500, Archie Cobbs wrote:


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;



If the system has madvise you probably get the requested functionality
with madvise(address, size, MADV_WILLNEED).



Aha! Yes, I had thought there was a function that did that. Thanks for the reminder, Mark.





reply via email to

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