Revert "Optimize dixLookupPrivate for repeated lookups of the same private."
The patch was wildly unsafe for SIGIO, and made everything full of
crashy crashy fail.
This reverts commit 9b30cc5248
.
This commit is contained in:
parent
ed9dabb47c
commit
60ff56050b
|
@ -46,20 +46,13 @@ dixAllocatePrivate(PrivateRec **privates, const DevPrivateKey key);
|
||||||
static _X_INLINE pointer
|
static _X_INLINE pointer
|
||||||
dixLookupPrivate(PrivateRec **privates, const DevPrivateKey key)
|
dixLookupPrivate(PrivateRec **privates, const DevPrivateKey key)
|
||||||
{
|
{
|
||||||
PrivateRec *rec, *prev;
|
PrivateRec *rec = *privates;
|
||||||
pointer *ptr;
|
pointer *ptr;
|
||||||
|
|
||||||
for (rec = *privates, prev = NULL; rec; prev = rec, rec = rec->next) {
|
while (rec) {
|
||||||
if (rec->key != key)
|
if (rec->key == key)
|
||||||
continue;
|
return rec->value;
|
||||||
|
rec = rec->next;
|
||||||
if (prev) {
|
|
||||||
prev->next = rec->next;
|
|
||||||
rec->next = *privates;
|
|
||||||
*privates = rec;
|
|
||||||
}
|
|
||||||
|
|
||||||
return rec->value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ptr = dixAllocatePrivate(privates, key);
|
ptr = dixAllocatePrivate(privates, key);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user