harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r658644 - /harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hymem.c
Date Wed, 21 May 2008 12:11:01 GMT
Author: odeakin
Date: Wed May 21 05:11:00 2008
New Revision: 658644

URL: http://svn.apache.org/viewvc?rev=658644&view=rev
Log:
Ensure we get 31bit pointers on z/OS s390.

Modified:
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hymem.c

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hymem.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hymem.c?rev=658644&r1=658643&r2=658644&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hymem.c (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hymem.c Wed
May 21 05:11:00 2008
@@ -71,6 +71,9 @@
                            "\nallocate of %u bytes (new total is %u bytes)\n",
                            byteAmount, DEBUG_TOTAL_ALLOCATED_MEMORY);
   mem = (void *) malloc (byteAmount + sizeof (UDATA));
+#if defined(HYS390)
+  mem = (void *) (((UDATA) mem) & 0x7FFFFFFF);
+#endif /* HYS390 */
   *((UDATA *) mem) = byteAmount;
   pointer = ((UDATA) mem + sizeof (UDATA));
 #else
@@ -78,7 +81,11 @@
     {                           /* prevent malloc from failing causing allocate to return
null */
       byteAmount = 1;
     }
+
   pointer = malloc (byteAmount);
+#if defined(HYS390)
+  pointer = (void *) (((UDATA) pointer) & 0x7FFFFFFF);
+#endif /* HYS390 */
 #endif
 
 
@@ -141,6 +148,9 @@
   Trc_PRT_mem_hymem_reallocate_memory_Entry (memoryPointer, byteAmount);
 
   ptr = realloc (memoryPointer, byteAmount);
+#if defined(HYS390)
+  ptr = (void *) (((UDATA) ptr) & 0x7FFFFFFF);
+#endif
 
   Trc_PRT_mem_hymem_reallocate_memory_Exit (ptr);
   return ptr;



Mime
View raw message