The following patch is to fix a data corruption issue that showed up on one of the test scripts.

I wrote up some more details in the thread:

Re: Data corruption - [EMAIL PROTECTED] - PERL_HV_ARRAY_ALLOC_BYTES?

The summary is that the size of the structure allocated for the HV data was based on the size of a pointer on the host system, and not the size of the structure.

So many writes to the structure will be past the allocated amount.

From what I can see, if and when the process access violation that results from this data corruption occurs is dependent on what logical names or symbols exist in the local VMS environment.

-John
[EMAIL PROTECTED]
Personal Opinion Only

--- hv.h_blead  Sat Jul 30 22:30:05 2005
+++ hv.h        Sat Jul 30 22:31:15 2005
@@ -352,13 +352,13 @@
 /* Default to allocating the correct size - default to assuming that malloc()
    is not broken and is efficient at allocating blocks sized at powers-of-two.
 */   
-#  define PERL_HV_ARRAY_ALLOC_BYTES(size) ((size) * sizeof(HE*))
+#  define PERL_HV_ARRAY_ALLOC_BYTES(size) ((size) * sizeof(HE))
 #else
 #  define MALLOC_OVERHEAD 16
 #  define PERL_HV_ARRAY_ALLOC_BYTES(size) \
                        (((size) < 64)                                  \
-                        ? (size) * sizeof(HE*)                         \
-                        : (size) * sizeof(HE*) * 2 - MALLOC_OVERHEAD)
+                        ? (size) * sizeof(HE)                          \
+                        : (size) * sizeof(HE) * 2 - MALLOC_OVERHEAD)
 #endif
 
 /* Flags for hv_iternext_flags.  */

Reply via email to