summaryrefslogtreecommitdiff
path: root/hv.h
diff options
context:
space:
mode:
authorMark Fisher <fisherm@tce.com>2000-08-28 11:24:59 -0500
committerJarkko Hietaniemi <jhi@iki.fi>2000-08-28 21:33:49 +0000
commit5cbe4eec85fac3e4bdde4a7b730b88994a9df29e (patch)
tree1ecf787aebd928f8a62b10e31bd12163e1ebc5fb /hv.h
parentc1a7f87b549f2a07381406dc80613bd49a251e30 (diff)
downloadperl-5cbe4eec85fac3e4bdde4a7b730b88994a9df29e.tar.gz
hv.h Doc Patch
Message-ID: <B9B6874277EED211B1890008C707AF5302881C77@indyexch3.indy.tce.com> p4raw-id: //depot/perl@6866
Diffstat (limited to 'hv.h')
-rw-r--r--hv.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/hv.h b/hv.h
index 5bc38a0a79..08f3bed7d5 100644
--- a/hv.h
+++ b/hv.h
@@ -7,21 +7,25 @@
*
*/
+/* typedefs to eliminate some typing */
typedef struct he HE;
typedef struct hek HEK;
+/* entry in hash value chain */
struct he {
- HE *hent_next;
- HEK *hent_hek;
- SV *hent_val;
+ HE *hent_next; /* next entry in chain */
+ HEK *hent_hek; /* hash key */
+ SV *hent_val; /* scalar value that was hashed */
};
+/* hash key -- defined separately for use as shared pointer */
struct hek {
- U32 hek_hash;
- I32 hek_len;
- char hek_key[1];
+ U32 hek_hash; /* hash of key */
+ I32 hek_len; /* length of hash key */
+ char hek_key[1]; /* variable-length hash key */
};
+/* hash structure: */
/* This structure must match the beginning of struct xpvmg in sv.h. */
struct xpvhv {
char * xhv_array; /* pointer to malloced string */
@@ -38,6 +42,7 @@ struct xpvhv {
char *xhv_name; /* name, if a symbol table */
};
+/* hash a key */
#define PERL_HASH(hash,str,len) \
STMT_START { \
register const char *s_PeRlHaSh = str; \
@@ -171,6 +176,7 @@ C<SV*>.
#define HEK_LEN(hek) (hek)->hek_len
#define HEK_KEY(hek) (hek)->hek_key
+/* calculate HV array allocation */
#if defined(STRANGE_MALLOC) || defined(MYMALLOC)
# define PERL_HV_ARRAY_ALLOC_BYTES(size) ((size) * sizeof(HE*))
#else