[elephant-devel] db gc

Antonio Menezes Leitao aml at gia.ist.utl.pt
Fri Mar 18 09:49:54 UTC 2005


Hi,

Ben <ben at medianstrip.net> writes:

> those have already been solved, you have to use what is in CVS though.
> also upgrade to sleepycat 4.3.
>

I'm using the CVS version and I upgraded do 4.3 but I just can't get
it working.

Aparently, the problem is that SBCL doesn't read (correctly) a db that
was created using Allegro 7.0.

I'm not sure if the problem is in SBCL or in Allegro 7.0.

Here's what I did:

First, I modified elephant to work with Allegro 7.0. Here are my
changes:

Index: Makefile
===================================================================
RCS file: /project/elephant/cvsroot/elephant/Makefile,v
retrieving revision 1.6
diff -u -r1.6 Makefile
--- Makefile	24 Feb 2005 01:06:20 -0000	1.6
+++ Makefile	18 Mar 2005 09:36:19 -0000
@@ -7,13 +7,13 @@
 SHELL=/bin/sh
 UNAME:=$(shell uname -s)
 
-DB43DIR=/db/ben/lisp/db43
-DBLIBDIR=$(DB43DIR)/lib/
-DBINCDIR=$(DB43DIR)/include/
+#DB43DIR=/db/ben/lisp/db43
+#DBLIBDIR=$(DB43DIR)/lib/
+#DBINCDIR=$(DB43DIR)/include/
 
 # *BSD users will probably want
-#DBLIBDIR=/usr/local/lib/db43
-#DBINCDIR=/usr/local/include/db43
+DBLIBDIR=/usr/lib/
+DBINCDIR=/usr/include/
 
 ifeq (Darwin,$(UNAME))
 	SHARED=-bundle



Index: src/elephant.lisp
===================================================================
RCS file: /project/elephant/cvsroot/elephant/src/elephant.lisp,v
retrieving revision 1.14
diff -u -r1.14 elephant.lisp
--- src/elephant.lisp	24 Feb 2005 01:07:52 -0000	1.14
+++ src/elephant.lisp	18 Mar 2005 09:40:01 -0000
@@ -187,7 +187,10 @@
 		slot-definition-initargs
 		class-finalized-p
 		finalize-inheritance
-		compute-slots)
+		compute-slots
+		class-direct-slots
+		slot-definition-readers
+		slot-definition-writers)
   #+allegro
   (:import-from :excl
 		compute-effective-slot-definition-initargs)

Index: src/sleepycat.lisp
===================================================================
RCS file: /project/elephant/cvsroot/elephant/src/sleepycat.lisp,v
retrieving revision 1.13
diff -u -r1.13 sleepycat.lisp
--- src/sleepycat.lisp	24 Feb 2005 01:06:09 -0000	1.13
+++ src/sleepycat.lisp	18 Mar 2005 09:40:32 -0000
@@ -135,15 +135,17 @@
   ;; This one worked for me.  There are known issues with
   ;; Red Hat and Berkeley DB, search google.
   #+linux
-  (unless 
-      (uffi:load-foreign-library "/lib/tls/libpthread.so.0" :module "pthread")
+  (unless
+      #+allegro (uffi:load-foreign-library "/home/aml/LispEssentials/elephant/allegro7.0/libpthread.so" :module "pthread")
+      #-allegro (uffi:load-foreign-library "/lib/tls/libpthread.so.0" :module "pthread")
     (error "Couldn't load libpthread!"))
 
   (unless
       (uffi:load-foreign-library 
        ;; Sleepycat: this works on linux
        #+linux
-       "/db/ben/lisp/db43/lib/libdb.so" 
+       ;;"/db/ben/lisp/db43/lib/libdb.so"
+       "/usr/lib/libdb-4.3.so"
        ;; this works on FreeBSD
        #+(and (or bsd freebsd) (not darwin))
        "/usr/local/lib/db43/libdb.so" 
@@ -185,7 +187,7 @@
 		 buffer-write-float buffer-write-double buffer-write-string
 		 buffer-read-byte buffer-read-fixnum buffer-read-int
 		 buffer-read-uint buffer-read-float buffer-read-double 
-		 #-(and allegreo ics) buffer-read-ucs1-string
+		 #-(and allegro ics) buffer-read-ucs1-string
 		 #+(or lispworks (and allegro ics)) buffer-read-ucs2-string
 		 #+(and sbcl sb-unicode) buffer-read-ucs4-string))
 

Using these changes, I created a db and populated it with lots of
objects.  There's one root object that is the unique entry point for
all the others.  In Allegro 7.0, this root object has oid 0. Later on,
I close Allegro and start SBCL. When I read the root object in SBCL,
its oid is 7000 and the object is "empty" (that is, it doesn't
reference any other objects).

Do you have any idea about what's happening?

Thanks in advance,

António Leitão.



More information about the elephant-devel mailing list