Announce: MMapper Library Available
Hello all,We decided to release our MMapper library to the public -- a library that extends the FLI in Lispworks to deal with memory mapped files. The library is in current use in our production code, handles OS X and Windows, both 32-bit and 64-bit versions of Lispworks. Our BTree code in Okeanos, among others, uses this library for its fast access. Of course, there are areas that could use some polish for extended uses.
We welcome your comments and improvements. The license is quite liberal -- have a look...
Download from:
The library comes with an ASDF loader. Sections of the code that aren't germane to public use have been conditionally elided with the #+:COM.SD symbol. (i.e., you should not have :COM.SD in your *FEATURES* list, else you will run into missing components).
Documentation for the library is currently in the source files, and the TEST.LISP file shows examples of use.
There are two layers to the library -- the lowest layer implements FLI extensions to MMPTR objects which represent virtual address pointers relative to the start of a file. This lower layer is quite useful in its own right. You can perform FETCH and STORE of scalar items, vectors, arrays, ASCII strings, and struct slots.
Atop that lower layer, we build smart classes for persistent objects -- persistent in the sense that they refer to C structs that can be stored in the file. The example shown in TEST.LISP has plenty of demonstrable instances of the use of this higher level protocol. In every case, a C struct is defined first, for the information as it is stored on the file. Then a class is defined, derived from mmf:persistent-metalevel-class that refers to that C struct. Slots in the persistent objects can be normal slots, persistent slots, and computed slots. Slots can be cached for speedup of frequently examined pieces of file data.
I think it would be possible, but highly tedious, to port this code to some other Lisp, like Allegro or SBCL. I make no apologies for making this code LW-centric. The library code should be self-contained, needing no additional macros from other sources. Along with our code is a shamelessly hacked copy of the UUID library from Boian Tzonev. (We make heavy use of UUID's in our databases.)
Enjoy!
Dr. David McClain
Chief Technical Officer
Refined Audiometrics Laboratory
4391 N. Camino Ferreo
Tucson, AZ 85750
email: dbm@refined-audiometrics.com
phone: 1.520.390.3995