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
commitaa502e3df72230e70d29992aa6c86d20fa763ad2 (patch)
tree58efea7fd3e3f003a26aa8ba1af6e4d6e9bd6e10 /hv.h
parent1805bb1e29cc4a2dc2784188b5a034809ee0085a (diff)
downloadperl-aa502e3df72230e70d29992aa6c86d20fa763ad2.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