caved in: Algorithms for for storing free space.

Ben Greear greear at cyberhighway.net
Sat Apr 4 19:30:00 CEST 1998


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 at cyberhighway.net)  http://www.primenet.com/~greear 
Author of ScryMUD:  mud.primenet.com 4444
http://www.primenet.com/~greear/ScryMUD/scry.html




More information about the mud-dev-archive mailing list