summaryrefslogtreecommitdiff
path: root/hv.h
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-11-08 11:25:49 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-11-08 11:25:49 +0000
commitd18c61170a30691556a1da7413e13241a92f4e0a (patch)
tree58efea7fd3e3f003a26aa8ba1af6e4d6e9bd6e10 /hv.h
parent5c831c245cbd15531aac8207bd2cc7d8bf7a2bab (diff)
downloadperl-d18c61170a30691556a1da7413e13241a92f4e0a.tar.gz
preliminary support for perl_clone() (still needs work in
the following areas: SVOPs must indirect via pad; context stack, scope stack, and runlevels must be cloned; must hook up the virtualized pseudo-process support provided by "host"; ...) p4raw-id: //depot/perl@4538
Diffstat (limited to 'hv.h')
-rw-r--r--hv.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/hv.h b/hv.h
index 3977b1c395..11a602c1b7 100644
--- a/hv.h
+++ b/hv.h
@@ -114,3 +114,13 @@ struct xpvhv {
#define HEK_HASH(hek) (hek)->hek_hash
#define HEK_LEN(hek) (hek)->hek_len
#define HEK_KEY(hek) (hek)->hek_key
+
+#if defined(STRANGE_MALLOC) || defined(MYMALLOC)
+# 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)
+#endif