Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZODB
Commits
53629c3c
Commit
53629c3c
authored
Nov 11, 2007
by
Christian Theune
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug 153316, backported from trunk
parent
24e67f1e
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
83 additions
and
56 deletions
+83
-56
NEWS.txt
NEWS.txt
+3
-0
src/BTrees/BTreeItemsTemplate.c
src/BTrees/BTreeItemsTemplate.c
+12
-12
src/BTrees/BTreeModuleTemplate.c
src/BTrees/BTreeModuleTemplate.c
+2
-0
src/BTrees/BTreeTemplate.c
src/BTrees/BTreeTemplate.c
+12
-12
src/BTrees/BucketTemplate.c
src/BTrees/BucketTemplate.c
+7
-7
src/BTrees/SetTemplate.c
src/BTrees/SetTemplate.c
+12
-12
src/BTrees/TreeSetTemplate.c
src/BTrees/TreeSetTemplate.c
+7
-7
src/BTrees/py24compat.h
src/BTrees/py24compat.h
+11
-0
src/persistent/cPersistence.c
src/persistent/cPersistence.c
+2
-2
src/persistent/cPersistence.h
src/persistent/cPersistence.h
+2
-0
src/persistent/cPickleCache.c
src/persistent/cPickleCache.c
+4
-4
src/persistent/py24compat.h
src/persistent/py24compat.h
+9
-0
No files found.
NEWS.txt
View file @
53629c3c
...
@@ -27,6 +27,9 @@ General
...
@@ -27,6 +27,9 @@ General
- (3.8.0b3) Added missing data attribute for conflict errors.
- (3.8.0b3) Added missing data attribute for conflict errors.
- (3.8.0b5) Fixed bug 153316: persistent and BTrees gave errors on x86_64
Intel XEON platforms.
ZEO
ZEO
---
---
...
...
src/BTrees/BTreeItemsTemplate.c
View file @
53629c3c
...
@@ -69,10 +69,10 @@ BTreeItems_dealloc(BTreeItems *self)
...
@@ -69,10 +69,10 @@ BTreeItems_dealloc(BTreeItems *self)
PyObject_DEL
(
self
);
PyObject_DEL
(
self
);
}
}
static
in
t
static
Py_ssize_
t
BTreeItems_length_or_nonzero
(
BTreeItems
*
self
,
int
nonzero
)
BTreeItems_length_or_nonzero
(
BTreeItems
*
self
,
int
nonzero
)
{
{
in
t
r
;
Py_ssize_
t
r
;
Bucket
*
b
,
*
next
;
Bucket
*
b
,
*
next
;
b
=
self
->
firstbucket
;
b
=
self
->
firstbucket
;
...
@@ -111,8 +111,8 @@ BTreeItems_length_or_nonzero(BTreeItems *self, int nonzero)
...
@@ -111,8 +111,8 @@ BTreeItems_length_or_nonzero(BTreeItems *self, int nonzero)
return
r
>=
0
?
r
:
0
;
return
r
>=
0
?
r
:
0
;
}
}
static
in
t
static
Py_ssize_
t
BTreeItems_length
(
BTreeItems
*
self
)
BTreeItems_length
(
BTreeItems
*
self
)
{
{
return
BTreeItems_length_or_nonzero
(
self
,
0
);
return
BTreeItems_length_or_nonzero
(
self
,
0
);
}
}
...
@@ -132,7 +132,7 @@ BTreeItems_length( BTreeItems *self)
...
@@ -132,7 +132,7 @@ BTreeItems_length( BTreeItems *self)
** self->currentbucket.
** self->currentbucket.
*/
*/
static
int
static
int
BTreeItems_seek
(
BTreeItems
*
self
,
in
t
i
)
BTreeItems_seek
(
BTreeItems
*
self
,
Py_ssize_
t
i
)
{
{
int
delta
,
pseudoindex
,
currentoffset
;
int
delta
,
pseudoindex
,
currentoffset
;
Bucket
*
b
,
*
currentbucket
;
Bucket
*
b
,
*
currentbucket
;
...
@@ -285,7 +285,7 @@ getBucketEntry(Bucket *b, int i, char kind)
...
@@ -285,7 +285,7 @@ getBucketEntry(Bucket *b, int i, char kind)
** (ie pulls the ith item out)
** (ie pulls the ith item out)
*/
*/
static
PyObject
*
static
PyObject
*
BTreeItems_item
(
BTreeItems
*
self
,
in
t
i
)
BTreeItems_item
(
BTreeItems
*
self
,
Py_ssize_
t
i
)
{
{
PyObject
*
result
;
PyObject
*
result
;
...
@@ -311,13 +311,13 @@ BTreeItems_item(BTreeItems *self, int i)
...
@@ -311,13 +311,13 @@ BTreeItems_item(BTreeItems *self, int i)
** Returns: BTreeItems item
** Returns: BTreeItems item
*/
*/
static
PyObject
*
static
PyObject
*
BTreeItems_slice
(
BTreeItems
*
self
,
int
ilow
,
in
t
ihigh
)
BTreeItems_slice
(
BTreeItems
*
self
,
Py_ssize_t
ilow
,
Py_ssize_
t
ihigh
)
{
{
Bucket
*
lowbucket
;
Bucket
*
lowbucket
;
Bucket
*
highbucket
;
Bucket
*
highbucket
;
int
lowoffset
;
int
lowoffset
;
int
highoffset
;
int
highoffset
;
in
t
length
=
-
1
;
/* len(self), but computed only if needed */
Py_ssize_
t
length
=
-
1
;
/* len(self), but computed only if needed */
/* Complications:
/* Complications:
* A Python slice never raises IndexError, but BTreeItems_seek does.
* A Python slice never raises IndexError, but BTreeItems_seek does.
...
@@ -386,11 +386,11 @@ BTreeItems_slice(BTreeItems *self, int ilow, int ihigh)
...
@@ -386,11 +386,11 @@ BTreeItems_slice(BTreeItems *self, int ilow, int ihigh)
}
}
static
PySequenceMethods
BTreeItems_as_sequence
=
{
static
PySequenceMethods
BTreeItems_as_sequence
=
{
(
inquiry
)
BTreeItems_length
,
(
lenfunc
)
BTreeItems_length
,
(
binaryfunc
)
0
,
(
binaryfunc
)
0
,
(
int
argfunc
)
0
,
(
ssize
argfunc
)
0
,
(
int
argfunc
)
BTreeItems_item
,
(
ssize
argfunc
)
BTreeItems_item
,
(
intint
argfunc
)
BTreeItems_slice
,
(
ssizessize
argfunc
)
BTreeItems_slice
,
};
};
/* Number Method items (just for nb_nonzero!) */
/* Number Method items (just for nb_nonzero!) */
...
...
src/BTrees/BTreeModuleTemplate.c
View file @
53629c3c
...
@@ -27,6 +27,8 @@
...
@@ -27,6 +27,8 @@
#define PER_ACCESSED(O) 1
#define PER_ACCESSED(O) 1
#endif
#endif
#include "py24compat.h"
/* So sue me. This pair gets used all over the place, so much so that it
/* So sue me. This pair gets used all over the place, so much so that it
* interferes with understanding non-persistence parts of algorithms.
* interferes with understanding non-persistence parts of algorithms.
* PER_UNUSE can be used after a successul PER_USE or PER_USE_OR_RETURN.
* PER_UNUSE can be used after a successul PER_USE or PER_USE_OR_RETURN.
...
...
src/BTrees/BTreeTemplate.c
View file @
53629c3c
...
@@ -1730,7 +1730,7 @@ BTree_setdefault(BTree *self, PyObject *args)
...
@@ -1730,7 +1730,7 @@ BTree_setdefault(BTree *self, PyObject *args)
}
}
/* forward declaration */
/* forward declaration */
static
in
t
static
Py_ssize_
t
BTree_length_or_nonzero
(
BTree
*
self
,
int
nonzero
);
BTree_length_or_nonzero
(
BTree
*
self
,
int
nonzero
);
static
PyObject
*
static
PyObject
*
...
@@ -2062,7 +2062,7 @@ BTree_tp_clear(BTree *self)
...
@@ -2062,7 +2062,7 @@ BTree_tp_clear(BTree *self)
* -1 error
* -1 error
* >= 0 number of elements.
* >= 0 number of elements.
*/
*/
static
in
t
static
Py_ssize_
t
BTree_length_or_nonzero
(
BTree
*
self
,
int
nonzero
)
BTree_length_or_nonzero
(
BTree
*
self
,
int
nonzero
)
{
{
int
result
;
int
result
;
...
@@ -2086,32 +2086,32 @@ BTree_length_or_nonzero(BTree *self, int nonzero)
...
@@ -2086,32 +2086,32 @@ BTree_length_or_nonzero(BTree *self, int nonzero)
return
result
;
return
result
;
}
}
static
in
t
static
Py_ssize_
t
BTree_length
(
BTree
*
self
)
BTree_length
(
BTree
*
self
)
{
{
return
BTree_length_or_nonzero
(
self
,
0
);
return
BTree_length_or_nonzero
(
self
,
0
);
}
}
static
PyMappingMethods
BTree_as_mapping
=
{
static
PyMappingMethods
BTree_as_mapping
=
{
(
inquiry
)
BTree_length
,
/*mp_length*/
(
lenfunc
)
BTree_length
,
/*mp_length*/
(
binaryfunc
)
BTree_get
,
/*mp_subscript*/
(
binaryfunc
)
BTree_get
,
/*mp_subscript*/
(
objobjargproc
)
BTree_setitem
,
/*mp_ass_subscript*/
(
objobjargproc
)
BTree_setitem
,
/*mp_ass_subscript*/
};
};
static
PySequenceMethods
BTree_as_sequence
=
{
static
PySequenceMethods
BTree_as_sequence
=
{
(
inquiry
)
0
,
/* sq_length */
(
lenfunc
)
0
,
/* sq_length */
(
binaryfunc
)
0
,
/* sq_concat */
(
binaryfunc
)
0
,
/* sq_concat */
(
intargfunc
)
0
,
/* sq_repeat */
(
ssizeargfunc
)
0
,
/* sq_repeat */
(
intargfunc
)
0
,
/* sq_item */
(
ssizeargfunc
)
0
,
/* sq_item */
(
intintargfunc
)
0
,
/* sq_slice */
(
ssizessizeargfunc
)
0
,
/* sq_slice */
(
intobjargproc
)
0
,
/* sq_ass_item */
(
ssizeobjargproc
)
0
,
/* sq_ass_item */
(
intintobjargproc
)
0
,
/* sq_ass_slice */
(
ssizessizeobjargproc
)
0
,
/* sq_ass_slice */
(
objobjproc
)
BTree_contains
,
/* sq_contains */
(
objobjproc
)
BTree_contains
,
/* sq_contains */
0
,
/* sq_inplace_concat */
0
,
/* sq_inplace_concat */
0
,
/* sq_inplace_repeat */
0
,
/* sq_inplace_repeat */
};
};
static
in
t
static
Py_ssize_
t
BTree_nonzero
(
BTree
*
self
)
BTree_nonzero
(
BTree
*
self
)
{
{
return
BTree_length_or_nonzero
(
self
,
1
);
return
BTree_length_or_nonzero
(
self
,
1
);
...
...
src/BTrees/BucketTemplate.c
View file @
53629c3c
...
@@ -1683,19 +1683,19 @@ Bucket_length( Bucket *self)
...
@@ -1683,19 +1683,19 @@ Bucket_length( Bucket *self)
}
}
static
PyMappingMethods
Bucket_as_mapping
=
{
static
PyMappingMethods
Bucket_as_mapping
=
{
(
inquiry
)
Bucket_length
,
/*mp_length*/
(
lenfunc
)
Bucket_length
,
/*mp_length*/
(
binaryfunc
)
bucket_getitem
,
/*mp_subscript*/
(
binaryfunc
)
bucket_getitem
,
/*mp_subscript*/
(
objobjargproc
)
bucket_setitem
,
/*mp_ass_subscript*/
(
objobjargproc
)
bucket_setitem
,
/*mp_ass_subscript*/
};
};
static
PySequenceMethods
Bucket_as_sequence
=
{
static
PySequenceMethods
Bucket_as_sequence
=
{
(
inquiry
)
0
,
/* sq_length */
(
lenfunc
)
0
,
/* sq_length */
(
binaryfunc
)
0
,
/* sq_concat */
(
binaryfunc
)
0
,
/* sq_concat */
(
intargfunc
)
0
,
/* sq_repeat */
(
ssizeargfunc
)
0
,
/* sq_repeat */
(
intargfunc
)
0
,
/* sq_item */
(
ssizeargfunc
)
0
,
/* sq_item */
(
intintargfunc
)
0
,
/* sq_slice */
(
ssizessizeargfunc
)
0
,
/* sq_slice */
(
intobjargproc
)
0
,
/* sq_ass_item */
(
ssizeobjargproc
)
0
,
/* sq_ass_item */
(
intintobjargproc
)
0
,
/* sq_ass_slice */
(
ssizessizeobjargproc
)
0
,
/* sq_ass_slice */
(
objobjproc
)
bucket_contains
,
/* sq_contains */
(
objobjproc
)
bucket_contains
,
/* sq_contains */
0
,
/* sq_inplace_concat */
0
,
/* sq_inplace_concat */
0
,
/* sq_inplace_repeat */
0
,
/* sq_inplace_repeat */
...
...
src/BTrees/SetTemplate.c
View file @
53629c3c
...
@@ -243,7 +243,7 @@ err:
...
@@ -243,7 +243,7 @@ err:
return
NULL
;
return
NULL
;
}
}
static
in
t
static
Py_ssize_
t
set_length
(
Bucket
*
self
)
set_length
(
Bucket
*
self
)
{
{
int
r
;
int
r
;
...
@@ -256,7 +256,7 @@ set_length(Bucket *self)
...
@@ -256,7 +256,7 @@ set_length(Bucket *self)
}
}
static
PyObject
*
static
PyObject
*
set_item
(
Bucket
*
self
,
in
t
index
)
set_item
(
Bucket
*
self
,
Py_ssize_
t
index
)
{
{
PyObject
*
r
=
0
;
PyObject
*
r
=
0
;
...
@@ -274,16 +274,16 @@ set_item(Bucket *self, int index)
...
@@ -274,16 +274,16 @@ set_item(Bucket *self, int index)
}
}
static
PySequenceMethods
set_as_sequence
=
{
static
PySequenceMethods
set_as_sequence
=
{
(
inquiry
)
set_length
,
/* sq_length */
(
lenfunc
)
set_length
,
/* sq_length */
(
binaryfunc
)
0
,
/* sq_concat */
(
binaryfunc
)
0
,
/* sq_concat */
(
intargfunc
)
0
,
/* sq_repeat */
(
ssizeargfunc
)
0
,
/* sq_repeat */
(
intargfunc
)
set_item
,
/* sq_item */
(
ssizeargfunc
)
set_item
,
/* sq_item */
(
intintargfunc
)
0
,
/* sq_slice */
(
ssizessizeargfunc
)
0
,
/* sq_slice */
(
intobjargproc
)
0
,
/* sq_ass_item */
(
ssizeobjargproc
)
0
,
/* sq_ass_item */
(
intintobjargproc
)
0
,
/* sq_ass_slice */
(
ssizessizeobjargproc
)
0
,
/* sq_ass_slice */
(
objobjproc
)
bucket_contains
,
/* sq_contains */
(
objobjproc
)
bucket_contains
,
/* sq_contains */
0
,
/* sq_inplace_concat */
0
,
/* sq_inplace_concat */
0
,
/* sq_inplace_repeat */
0
,
/* sq_inplace_repeat */
};
};
static
PyTypeObject
SetType
=
{
static
PyTypeObject
SetType
=
{
...
...
src/BTrees/TreeSetTemplate.c
View file @
53629c3c
...
@@ -170,17 +170,17 @@ static struct PyMethodDef TreeSet_methods[] = {
...
@@ -170,17 +170,17 @@ static struct PyMethodDef TreeSet_methods[] = {
};
};
static
PyMappingMethods
TreeSet_as_mapping
=
{
static
PyMappingMethods
TreeSet_as_mapping
=
{
(
inquiry
)
BTree_length
,
/*mp_length*/
(
lenfunc
)
BTree_length
,
/*mp_length*/
};
};
static
PySequenceMethods
TreeSet_as_sequence
=
{
static
PySequenceMethods
TreeSet_as_sequence
=
{
(
inquiry
)
0
,
/* sq_length */
(
lenfunc
)
0
,
/* sq_length */
(
binaryfunc
)
0
,
/* sq_concat */
(
binaryfunc
)
0
,
/* sq_concat */
(
intargfunc
)
0
,
/* sq_repeat */
(
ssizeargfunc
)
0
,
/* sq_repeat */
(
intargfunc
)
0
,
/* sq_item */
(
ssizeargfunc
)
0
,
/* sq_item */
(
intintargfunc
)
0
,
/* sq_slice */
(
ssizessizeargfunc
)
0
,
/* sq_slice */
(
intobjargproc
)
0
,
/* sq_ass_item */
(
ssizeobjargproc
)
0
,
/* sq_ass_item */
(
intintobjargproc
)
0
,
/* sq_ass_slice */
(
ssizessizeobjargproc
)
0
,
/* sq_ass_slice */
(
objobjproc
)
BTree_contains
,
/* sq_contains */
(
objobjproc
)
BTree_contains
,
/* sq_contains */
0
,
/* sq_inplace_concat */
0
,
/* sq_inplace_concat */
0
,
/* sq_inplace_repeat */
0
,
/* sq_inplace_repeat */
...
...
src/BTrees/py24compat.h
0 → 100644
View file @
53629c3c
/* Backport type definitions from Python 2.5's object.h */
#ifndef BTREE_PY24COMPATH_H
#define BTREE_PY24COMPAT_H
#if PY_VERSION_HEX < 0x02050000
typedef
Py_ssize_t
(
*
lenfunc
)(
PyObject
*
);
typedef
PyObject
*
(
*
ssizeargfunc
)(
PyObject
*
,
Py_ssize_t
);
typedef
PyObject
*
(
*
ssizessizeargfunc
)(
PyObject
*
,
Py_ssize_t
,
Py_ssize_t
);
typedef
int
(
*
ssizeobjargproc
)(
PyObject
*
,
Py_ssize_t
,
PyObject
*
);
typedef
int
(
*
ssizessizeobjargproc
)(
PyObject
*
,
Py_ssize_t
,
Py_ssize_t
,
PyObject
*
);
#endif
/* PY_VERSION_HEX */
#endif
/* BTREE_PY24COMPAT_H */
src/persistent/cPersistence.c
View file @
53629c3c
...
@@ -300,7 +300,7 @@ pickle_copy_dict(PyObject *state)
...
@@ -300,7 +300,7 @@ pickle_copy_dict(PyObject *state)
{
{
PyObject
*
copy
,
*
key
,
*
value
;
PyObject
*
copy
,
*
key
,
*
value
;
char
*
ckey
;
char
*
ckey
;
in
t
pos
=
0
;
Py_ssize_
t
pos
=
0
;
copy
=
PyDict_New
();
copy
=
PyDict_New
();
if
(
!
copy
)
if
(
!
copy
)
...
@@ -414,7 +414,7 @@ static int
...
@@ -414,7 +414,7 @@ static int
pickle_setattrs_from_dict
(
PyObject
*
self
,
PyObject
*
dict
)
pickle_setattrs_from_dict
(
PyObject
*
self
,
PyObject
*
dict
)
{
{
PyObject
*
key
,
*
value
;
PyObject
*
key
,
*
value
;
in
t
pos
=
0
;
Py_ssize_
t
pos
=
0
;
if
(
!
PyDict_Check
(
dict
))
{
if
(
!
PyDict_Check
(
dict
))
{
PyErr_SetString
(
PyExc_TypeError
,
"Expected dictionary"
);
PyErr_SetString
(
PyExc_TypeError
,
"Expected dictionary"
);
...
...
src/persistent/cPersistence.h
View file @
53629c3c
...
@@ -16,6 +16,8 @@
...
@@ -16,6 +16,8 @@
#define CPERSISTENCE_H
#define CPERSISTENCE_H
#include "Python.h"
#include "Python.h"
#include "py24compat.h"
#include "ring.h"
#include "ring.h"
#define CACHE_HEAD \
#define CACHE_HEAD \
...
...
src/persistent/cPickleCache.c
View file @
53629c3c
...
@@ -378,7 +378,7 @@ static PyObject *
...
@@ -378,7 +378,7 @@ static PyObject *
cc_invalidate
(
ccobject
*
self
,
PyObject
*
inv
)
cc_invalidate
(
ccobject
*
self
,
PyObject
*
inv
)
{
{
PyObject
*
key
,
*
v
;
PyObject
*
key
,
*
v
;
in
t
i
=
0
;
Py_ssize_
t
i
=
0
;
if
(
PyDict_Check
(
inv
))
if
(
PyDict_Check
(
inv
))
{
{
...
@@ -448,7 +448,7 @@ static PyObject *
...
@@ -448,7 +448,7 @@ static PyObject *
cc_klass_items
(
ccobject
*
self
)
cc_klass_items
(
ccobject
*
self
)
{
{
PyObject
*
l
,
*
k
,
*
v
;
PyObject
*
l
,
*
k
,
*
v
;
in
t
p
=
0
;
Py_ssize_
t
p
=
0
;
l
=
PyList_New
(
0
);
l
=
PyList_New
(
0
);
if
(
l
==
NULL
)
if
(
l
==
NULL
)
...
@@ -477,7 +477,7 @@ static PyObject *
...
@@ -477,7 +477,7 @@ static PyObject *
cc_debug_info
(
ccobject
*
self
)
cc_debug_info
(
ccobject
*
self
)
{
{
PyObject
*
l
,
*
k
,
*
v
;
PyObject
*
l
,
*
k
,
*
v
;
in
t
p
=
0
;
Py_ssize_
t
p
=
0
;
l
=
PyList_New
(
0
);
l
=
PyList_New
(
0
);
if
(
l
==
NULL
)
if
(
l
==
NULL
)
...
@@ -707,7 +707,7 @@ cc_dealloc(ccobject *self)
...
@@ -707,7 +707,7 @@ cc_dealloc(ccobject *self)
static
int
static
int
cc_clear
(
ccobject
*
self
)
cc_clear
(
ccobject
*
self
)
{
{
in
t
pos
=
0
;
Py_ssize_
t
pos
=
0
;
PyObject
*
k
,
*
v
;
PyObject
*
k
,
*
v
;
/* Clearing the cache is delicate.
/* Clearing the cache is delicate.
...
...
src/persistent/py24compat.h
0 → 100644
View file @
53629c3c
/* Backport type definitions from Python 2.5's object.h */
#ifndef PERSISTENT_PY24COMPATH_H
#define PERSISTENT_PY24COMPAT_H
#if PY_VERSION_HEX < 0x02050000
typedef
int
Py_ssize_t
;
#define PY_SSIZE_T_MAX INT_MAX
#define PY_SSIZE_T_MIN INT_MIN
#endif
/* PY_VERSION_HEX */
#endif
/* PERSISTENT_PY24COMPAT_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment