harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r691987 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSMemoryLinux32.c
Date Thu, 04 Sep 2008 12:08:21 GMT
Author: hindessm
Date: Thu Sep  4 05:08:20 2008
New Revision: 691987

URL: http://svn.apache.org/viewvc?rev=691987&view=rev
Log:
Fix for freebsd - which has unsigned char* as third argument to mincore.

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSMemoryLinux32.c

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSMemoryLinux32.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSMemoryLinux32.c?rev=691987&r1=691986&r2=691987&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSMemoryLinux32.c
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSMemoryLinux32.c
Thu Sep  4 05:08:20 2008
@@ -95,14 +95,20 @@
   	  jboolean result = 0;
   	  IDATA m_addr = (IDATA)addr;
 	  int page_size = getPageSize();
-	  unsigned char* vec = NULL;
+#if defined(FREEBSD)
+#define HY_VEC_T char
+#else
+#define HY_VEC_T unsigned char
+#endif
+	  HY_VEC_T* vec = NULL;
 	  int page_count = 0;
 	  int align_offset = m_addr%page_size;//addr should align with the boundary of a page.
 	  m_addr -= align_offset;
 	  size   += align_offset;
 	  page_count = (size+page_size-1)/page_size;
-	  vec = (unsigned char*) hymem_allocate_memory(page_count*sizeof(char));
-	  if(mincore((void *)m_addr, size , vec)==0) //or else there is error about the mincore
and return false;
+	  vec = (HY_VEC_T *) hymem_allocate_memory(page_count*sizeof(char));
+	  if(mincore((void *)m_addr, size, vec)==0) //or else there is error about the mincore and
return false;
+#undef HY_VEC_T
 	  {
 	  	  int i;
 		  for(i=0 ;i<page_count;i++)



Mime
View raw message