You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by od...@apache.org on 2008/05/21 14:11:01 UTC
svn commit: r658644 -
/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hymem.c
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;