Commit 7854cea5 authored by Jim Fulton's avatar Jim Fulton

Added some handy macros worked out in BTrees.

parent 295455b1
......@@ -136,6 +136,14 @@ static cPersistenceCAPIstruct *cPersistenceCAPI;
#define PER_DEL(O) Py_XDECREF((O)->jar); Py_XDECREF((O)->oid);
#define PER_USE(O) \
(((O)->state != cPersistent_GHOST_STATE \
|| (cPersistenceCAPI->setstate((PyObject*)(O)) >= 0)) \
? (((O)->state==cPersistent_UPTODATE_STATE) \
? ((O)->state=cPersistent_STICKY_STATE) : 1) : 0)
#define PER_ACCESSED(O) ((O)->atime=((long)(time(NULL)/3))%65536)
#endif
......@@ -136,6 +136,14 @@ static cPersistenceCAPIstruct *cPersistenceCAPI;
#define PER_DEL(O) Py_XDECREF((O)->jar); Py_XDECREF((O)->oid);
#define PER_USE(O) \
(((O)->state != cPersistent_GHOST_STATE \
|| (cPersistenceCAPI->setstate((PyObject*)(O)) >= 0)) \
? (((O)->state==cPersistent_UPTODATE_STATE) \
? ((O)->state=cPersistent_STICKY_STATE) : 1) : 0)
#define PER_ACCESSED(O) ((O)->atime=((long)(time(NULL)/3))%65536)
#endif
......@@ -136,6 +136,14 @@ static cPersistenceCAPIstruct *cPersistenceCAPI;
#define PER_DEL(O) Py_XDECREF((O)->jar); Py_XDECREF((O)->oid);
#define PER_USE(O) \
(((O)->state != cPersistent_GHOST_STATE \
|| (cPersistenceCAPI->setstate((PyObject*)(O)) >= 0)) \
? (((O)->state==cPersistent_UPTODATE_STATE) \
? ((O)->state=cPersistent_STICKY_STATE) : 1) : 0)
#define PER_ACCESSED(O) ((O)->atime=((long)(time(NULL)/3))%65536)
#endif
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