Commit e8ea38fb authored by Jeremy Hylton's avatar Jeremy Hylton

Don't use the HOME() macro in unghostify(). Get a pointer to the

ring_home and use it explicitly.

Remove now unused KEEP_THIS_ONE_AROUND_FOR_A_WHILE() macro.
parent db5a7f5a
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
static char cPersistence_doc_string[] = static char cPersistence_doc_string[] =
"Defines Persistent mixin class for persistent objects.\n" "Defines Persistent mixin class for persistent objects.\n"
"\n" "\n"
"$Id: cPersistence.c,v 1.55 2002/04/02 22:17:24 bwarsaw Exp $\n"; "$Id: cPersistence.c,v 1.56 2002/04/02 22:29:34 jeremy Exp $\n";
#include "cPersistence.h" #include "cPersistence.h"
...@@ -129,12 +129,13 @@ unghostify(cPersistentObject *self) ...@@ -129,12 +129,13 @@ unghostify(cPersistentObject *self)
/* XXX Is it ever possibly to not have a cache? */ /* XXX Is it ever possibly to not have a cache? */
if (self->cache) { if (self->cache) {
CPersistentRing *home = &self->cache->ring_home;
/* Create a node in the ring for this unghostified object. */ /* Create a node in the ring for this unghostified object. */
self->cache->non_ghost_count++; self->cache->non_ghost_count++;
self->ring.next = &self->cache->ring_home; self->ring.next = home;
self->ring.prev = (&(self)->cache->ring_home)->prev; self->ring.prev = home->prev;
HOME(self)->prev->next = &self->ring; home->prev->next = &self->ring;
HOME(self)->prev = &self->ring; home->prev = &self->ring;
Py_INCREF(self); Py_INCREF(self);
} }
self->state = cPersistent_CHANGED_STATE; self->state = cPersistent_CHANGED_STATE;
...@@ -150,9 +151,6 @@ unghostify(cPersistentObject *self) ...@@ -150,9 +151,6 @@ unghostify(cPersistentObject *self)
return 1; return 1;
} }
#define KEEP_THIS_ONE_AROUND_FOR_A_WHILE(self) accessed(self)
/****************************************************************************/ /****************************************************************************/
staticforward PyExtensionClass Pertype; staticforward PyExtensionClass Pertype;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
static char cPersistence_doc_string[] = static char cPersistence_doc_string[] =
"Defines Persistent mixin class for persistent objects.\n" "Defines Persistent mixin class for persistent objects.\n"
"\n" "\n"
"$Id: cPersistence.c,v 1.55 2002/04/02 22:17:24 bwarsaw Exp $\n"; "$Id: cPersistence.c,v 1.56 2002/04/02 22:29:34 jeremy Exp $\n";
#include "cPersistence.h" #include "cPersistence.h"
...@@ -129,12 +129,13 @@ unghostify(cPersistentObject *self) ...@@ -129,12 +129,13 @@ unghostify(cPersistentObject *self)
/* XXX Is it ever possibly to not have a cache? */ /* XXX Is it ever possibly to not have a cache? */
if (self->cache) { if (self->cache) {
CPersistentRing *home = &self->cache->ring_home;
/* Create a node in the ring for this unghostified object. */ /* Create a node in the ring for this unghostified object. */
self->cache->non_ghost_count++; self->cache->non_ghost_count++;
self->ring.next = &self->cache->ring_home; self->ring.next = home;
self->ring.prev = (&(self)->cache->ring_home)->prev; self->ring.prev = home->prev;
HOME(self)->prev->next = &self->ring; home->prev->next = &self->ring;
HOME(self)->prev = &self->ring; home->prev = &self->ring;
Py_INCREF(self); Py_INCREF(self);
} }
self->state = cPersistent_CHANGED_STATE; self->state = cPersistent_CHANGED_STATE;
...@@ -150,9 +151,6 @@ unghostify(cPersistentObject *self) ...@@ -150,9 +151,6 @@ unghostify(cPersistentObject *self)
return 1; return 1;
} }
#define KEEP_THIS_ONE_AROUND_FOR_A_WHILE(self) accessed(self)
/****************************************************************************/ /****************************************************************************/
staticforward PyExtensionClass Pertype; staticforward PyExtensionClass Pertype;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
static char cPersistence_doc_string[] = static char cPersistence_doc_string[] =
"Defines Persistent mixin class for persistent objects.\n" "Defines Persistent mixin class for persistent objects.\n"
"\n" "\n"
"$Id: cPersistence.c,v 1.55 2002/04/02 22:17:24 bwarsaw Exp $\n"; "$Id: cPersistence.c,v 1.56 2002/04/02 22:29:34 jeremy Exp $\n";
#include "cPersistence.h" #include "cPersistence.h"
...@@ -129,12 +129,13 @@ unghostify(cPersistentObject *self) ...@@ -129,12 +129,13 @@ unghostify(cPersistentObject *self)
/* XXX Is it ever possibly to not have a cache? */ /* XXX Is it ever possibly to not have a cache? */
if (self->cache) { if (self->cache) {
CPersistentRing *home = &self->cache->ring_home;
/* Create a node in the ring for this unghostified object. */ /* Create a node in the ring for this unghostified object. */
self->cache->non_ghost_count++; self->cache->non_ghost_count++;
self->ring.next = &self->cache->ring_home; self->ring.next = home;
self->ring.prev = (&(self)->cache->ring_home)->prev; self->ring.prev = home->prev;
HOME(self)->prev->next = &self->ring; home->prev->next = &self->ring;
HOME(self)->prev = &self->ring; home->prev = &self->ring;
Py_INCREF(self); Py_INCREF(self);
} }
self->state = cPersistent_CHANGED_STATE; self->state = cPersistent_CHANGED_STATE;
...@@ -150,9 +151,6 @@ unghostify(cPersistentObject *self) ...@@ -150,9 +151,6 @@ unghostify(cPersistentObject *self)
return 1; return 1;
} }
#define KEEP_THIS_ONE_AROUND_FOR_A_WHILE(self) accessed(self)
/****************************************************************************/ /****************************************************************************/
staticforward PyExtensionClass Pertype; staticforward PyExtensionClass Pertype;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment