/* hv.h
*
* Copyright (C) 1991, 1992, 1993, 1996, 1997, 1998, 1999,
- * 2000, 2001, 2002, by Larry Wall and others
+ * 2000, 2001, 2002, 2005, by Larry Wall and others
*
* You may distribute under the terms of either the GNU General Public
* License or the Artistic License, as specified in the README file.
I32 xhv_riter; /* current root of iterator */
HE *xhv_eiter; /* current entry of iterator */
- PMOP *xhv_pmroot; /* list of pm's for this package */
+ /* list of pm's for this package is now stored in symtab magic. */
char *xhv_name; /* name, if a symbol table */
};
* If USE_HASH_SEED_EXPLICIT is defined, hash randomisation is done
* only if the environment variable PERL_HASH_SEED is set.
* For maximal control, one can define PERL_HASH_SEED.
- * (see also erl.c:perl_parse()).
+ * (see also perl.c:perl_parse()).
*/
#ifndef PERL_HASH_SEED
# if defined(USE_HASH_SEED) || defined(USE_HASH_SEED_EXPLICIT)
(hash) = (hash_PeRlHaSh + (hash_PeRlHaSh << 15)); \
} STMT_END
-#if defined (PERL_IN_HV_C) || defined (MOD_PERL)
+/* Only hv.c and mod_perl should be doing this. */
+#ifdef PERL_HASH_INTERNAL_ACCESS
#define PERL_HASH_INTERNAL(hash,str,len) \
STMT_START { \
register const char *s_PeRlHaSh_tmp = str; \
register const unsigned char *s_PeRlHaSh = (const unsigned char *)s_PeRlHaSh_tmp; \
register I32 i_PeRlHaSh = len; \
- register U32 hash_PeRlHaSh = PL_new_hash_seed; \
+ register U32 hash_PeRlHaSh = PL_rehash_seed; \
while (i_PeRlHaSh--) { \
hash_PeRlHaSh += *s_PeRlHaSh++; \
hash_PeRlHaSh += (hash_PeRlHaSh << 10); \
#define HvMAX(hv) ((XPVHV*) SvANY(hv))->xhv_max
#define HvRITER(hv) ((XPVHV*) SvANY(hv))->xhv_riter
#define HvEITER(hv) ((XPVHV*) SvANY(hv))->xhv_eiter
-#define HvPMROOT(hv) ((XPVHV*) SvANY(hv))->xhv_pmroot
#define HvNAME(hv) ((XPVHV*) SvANY(hv))->xhv_name
/* the number of keys (including any placeholers) */
#define HEK_REHASH_on(hek) (HEK_FLAGS(hek) |= HVhek_REHASH)
/* calculate HV array allocation */
-#if defined(STRANGE_MALLOC) || defined(MYMALLOC)
+#ifndef PERL_USE_LARGE_HV_ALLOC
+/* 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*))
#else
# define MALLOC_OVERHEAD 16