caved in: Algorithms for for storing free space.

Ben Greear greear at
Sat Apr 4 19:30:00 New Zealand Daylight Time 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??


Ben Greear (greear at 
Author of ScryMUD: 4444

More information about the MUD-Dev mailing list