[Home] [Groups] - Message: [Prev in Group] [Next in Group]
6123: caved in: Algorithms for for storing free space.
[Full Header] [Plain Text]
From: Ben Greear <greear@cyberhighway.net>
Newsgroups: nu.kanga.list.mud-dev
Date: Sat, 4 Apr 1998 19:30:00 -0700 (MST)
Organization: Kanga.Nu
Well, after I quit being so bone-headed, (and envisioned a delete option
for my db) I quickly saw that I needed to manage free space much
better for my db.
I'm sure this has been done many times before, but any quick hints would
be welcome. I want to keep with a single db-file approach, wich rules out
the (really cool) idea involving powers of 2 that was posted recently...
Perhaps an array of linked lists(stacks would be fine), the array being 32
long, mimicing the powers of two idea?
Each stack will hold seek positions into the DB file....
So here's a question, what's a good way to determine the
power of two that is optimal for the storage space needed?
A binary search wouldn't be too bad, just wondering if there's
a better (constant) method??
Enjoy,
Ben
Ben Greear (greear@cyberhighway.net) http://www.primenet.com/~greear
Author of ScryMUD: mud.primenet.com 4444
http://www.primenet.com/~greear/ScryMUD/scry.html