msg00662.html

1999Q1/msg00662.html · 7.6 KB

From the archive 1999Q1.zip

Download the archive   « Back to the archive contents

<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD&#45;Dev] Naming and Directories? -->
<!--X-From-R13: Ayn Tbfurvz =?vfb&#45;8859&#45;1?C?Ue=T8fgnq?= <byntNvsv.hvb.ab> -->
<!--X-Date: Sat, 20 Mar 1999 08:15:54 &#45;0800 -->
<!--X-Message-Id: 36F24E75.F9216D11#ifi,uio.no -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 199903190249.SAA30725#erdos,Stanford.EDU -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, Re: [MUD-Dev] Naming and Directories?</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:olag#ifi,uio.no">
</head>
<body background="/backgrounds/paperback.gif" bgcolor="#ffffff"
      text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000">

  <font size="+4" color="#804040">
    <strong><em>MUD-Dev<br>mailing list archive</em></strong>
  </font>
      
<br>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->

Date:&nbsp;
[&nbsp;<a href="msg00661.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00663.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00656.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00644.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00662">Author</A>
&nbsp;|&nbsp;<A HREF="#00662">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00662">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Re: [MUD-Dev] Naming and Directories?</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
<LI><em>Subject</em>: Re: [MUD-Dev] Naming and Directories?</LI>
<LI><em>From</em>: Ola Fosheim Grøstad &lt;<A HREF="mailto:olag#ifi,uio.no">olag#ifi,uio.no</A>&gt;</LI>
<LI><em>Date</em>: Fri, 19 Mar 1999 14:17:41 +0100</LI>
<LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
<LI><em>Sender</em>: <A HREF="mailto:mud-dev-admin#kanga,nu">mud-dev-admin#kanga,nu</A></LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
Mark Gritter wrote:
&gt; &lt;GEEK mode='os/architecture'&gt;
&gt; There's actually a solution for handling "prefix" lookups that gets used
&gt; (well, discussed, anyway) in handling TLB misses.  Say you have various page
&gt; sizes, and aren't sure which size to use when looking in your inverted page
&gt; table.  Just duplicate the entry for each of the possible prefixes.  So in
&gt; terms of our discussion, add 'Mark', 'Mar', 'Ma', and 'M' to the hash table,
&gt; stopping when there's a conflict with another name.
&gt; &lt;/GEEK&gt;

Interesting application. I think I already mentioned hashing substrings
when all those trie-freaks cried for abbrevs.

&gt; Doh!  I was aiming for sizeof(struct node) == 32, but forgot the object
&gt; pointer...  plus, you'd have to throw it out and start over for a new
&gt; pointer size.  Your idea seems better, with those considerations.

Or more memory efficient:

struct node {
  object *obj; 
  node *l,*r;
  const char key[1];
};

node *new_node(char *s){
  node *n = 0;
  const char *k=n-&gt;key;

  // Ugly and not fully portable? An option would be to declare
  // key[4] and use sizeof(node)-3+strlen(s)

  size_t keyoffset=*(size_t*)(void*)&amp;k;
  size_t keysize = strlen(s);

  void *n = calloc(1, keyoffset + keysize + 1);  
  assert(n);
  memcpy(((char*)n)+keyoffset,s,keysize + 1);
  return (node*)n;
}


Another option is to use a heap/array with the 32-bit integer version
discussed previously (reorganizing the tree will be expensive though, so
I doubt I will ever use it):

struct node { uint32 key; object *obj; };
node binarytree[LARGE_NUMBER];
--
Ola Fosheim Groestad,Norway      <A  HREF="http://www.stud.ifi.uio.no/~olag/">http://www.stud.ifi.uio.no/~olag/</A>




_______________________________________________
MUD-Dev maillist  -  MUD-Dev#kanga,nu
<A  HREF="http://www.kanga.nu/lists/listinfo/mud-dev">http://www.kanga.nu/lists/listinfo/mud-dev</A>


</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00656" HREF="msg00656.html">Re: [MUD-Dev] Naming and Directories?</A></STRONG>
<UL><LI><EM>From:</EM> Mark Gritter &lt;mark#erdos,Stanford.EDU&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00661.html">Re: [MUD-Dev] Mass Creation OLC Functions (idea from Elder Games)</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00663.html">Re: [MUD-Dev] Mass Creation OLC Functions (idea from Elder Games)</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00656.html">Re: [MUD-Dev] Naming and Directories?</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00644.html">Re: [MUD-Dev] Naming and Directories?</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00662"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00662"><STRONG>Thread</STRONG></A></LI>
</UL>
</LI>
</UL>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<ul><li>Thread context:
<BLOCKQUOTE><UL>
<LI><STRONG>Re: [MUD-Dev] Naming and Directories?</STRONG>, <EM>(continued)</EM>
<ul compact>
<ul compact>
<ul compact>
<ul compact>
<ul compact>
<ul compact>
<LI><strong><A NAME="00628" HREF="msg00628.html">Re: [MUD-Dev] Naming and Directories?</A></strong>, 
Ola Fosheim Grøstad <a href="mailto:olag#ifi,uio.no">olag#ifi,uio.no</a>, Wed 17 Mar 1999, 08:43 GMT
<UL>
<LI><strong><A NAME="00638" HREF="msg00638.html">Re: [MUD-Dev] Naming and Directories?</A></strong>, 
Mark Gritter <a href="mailto:mark#erdos,Stanford.EDU">mark#erdos,Stanford.EDU</a>, Wed 17 Mar 1999, 18:03 GMT
<UL>
<LI><strong><A NAME="00652" HREF="msg00652.html">Re: [MUD-Dev] Naming and Directories?</A></strong>, 
Ola Fosheim Grøstad <a href="mailto:olag#ifi,uio.no">olag#ifi,uio.no</a>, Thu 18 Mar 1999, 17:54 GMT
<UL>
<LI><strong><A NAME="00656" HREF="msg00656.html">Re: [MUD-Dev] Naming and Directories?</A></strong>, 
Mark Gritter <a href="mailto:mark#erdos,Stanford.EDU">mark#erdos,Stanford.EDU</a>, Thu 18 Mar 1999, 18:58 GMT
<LI><strong><A NAME="00662" HREF="msg00662.html">Re: [MUD-Dev] Naming and Directories?</A></strong>, 
Ola Fosheim Grøstad <a href="mailto:olag#ifi,uio.no">olag#ifi,uio.no</a>, Sat 20 Mar 1999, 16:15 GMT
</LI>
</LI>
</UL>
</LI>
</UL>
</LI>
<LI><strong><A NAME="00644" HREF="msg00644.html">Re: [MUD-Dev] Naming and Directories?</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Thu 18 Mar 1999, 07:44 GMT
<UL>
<LI><strong><A NAME="00653" HREF="msg00653.html">Re: [MUD-Dev] Naming and Directories?</A></strong>, 
Ola Fosheim Grøstad <a href="mailto:olag#ifi,uio.no">olag#ifi,uio.no</a>, Thu 18 Mar 1999, 17:54 GMT
<UL>
<LI><strong><A NAME="00660" HREF="msg00660.html">Re: [MUD-Dev] Naming and Directories?</A></strong>, 
J C Lawrence <a href="mailto:claw#varesearch,com">claw#varesearch,com</a>, Fri 19 Mar 1999, 11:38 GMT
<LI><strong><A NAME="00664" HREF="msg00664.html">Re: [MUD-Dev] Naming and Directories?</A></strong>, 
Ola Fosheim Grøstad <a href="mailto:olag#ifi,uio.no">olag#ifi,uio.no</a>, Sat 20 Mar 1999, 16:16 GMT
</LI>
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</LI>
</ul>
</ul>
</ul>
</ul>
</ul>
</ul>
</LI>
</UL></BLOCKQUOTE>

</ul>
<hr>
<center>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
</center>
<hr>
</body>
</html>

Site Stats

Snippets: 1791
Codebases: 571