mirror of
https://github.com/fluencelabs/redis
synced 2025-03-20 01:20:50 +00:00
Merge pull request #3006 from baishaofei/unstable
fix linux compile Error zmalloc.c:109: error: invalid lvalue in unary `&'
This commit is contained in:
commit
0c1f84f0ea
@ -65,7 +65,7 @@ int dbAsyncDelete(redisDb *db, robj *key) {
|
|||||||
/* If releasing the object is too much work, let's put it into the
|
/* If releasing the object is too much work, let's put it into the
|
||||||
* lazy free list. */
|
* lazy free list. */
|
||||||
if (free_effort > LAZYFREE_THRESHOLD) {
|
if (free_effort > LAZYFREE_THRESHOLD) {
|
||||||
atomicIncr(lazyfree_objects,1,&lazyfree_objects_mutex);
|
atomicIncr(lazyfree_objects,1,lazyfree_objects_mutex);
|
||||||
bioCreateBackgroundJob(BIO_LAZY_FREE,val,NULL,NULL);
|
bioCreateBackgroundJob(BIO_LAZY_FREE,val,NULL,NULL);
|
||||||
dictSetVal(db->dict,de,NULL);
|
dictSetVal(db->dict,de,NULL);
|
||||||
}
|
}
|
||||||
@ -89,7 +89,7 @@ void emptyDbAsync(redisDb *db) {
|
|||||||
db->dict = dictCreate(&dbDictType,NULL);
|
db->dict = dictCreate(&dbDictType,NULL);
|
||||||
db->expires = dictCreate(&keyptrDictType,NULL);
|
db->expires = dictCreate(&keyptrDictType,NULL);
|
||||||
atomicIncr(lazyfree_objects,dictSize(oldht1),
|
atomicIncr(lazyfree_objects,dictSize(oldht1),
|
||||||
&lazyfree_objects_mutex);
|
lazyfree_objects_mutex);
|
||||||
bioCreateBackgroundJob(BIO_LAZY_FREE,NULL,oldht1,oldht2);
|
bioCreateBackgroundJob(BIO_LAZY_FREE,NULL,oldht1,oldht2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ void slotToKeyFlushAsync(void) {
|
|||||||
zskiplist *oldsl = server.cluster->slots_to_keys;
|
zskiplist *oldsl = server.cluster->slots_to_keys;
|
||||||
server.cluster->slots_to_keys = zslCreate();
|
server.cluster->slots_to_keys = zslCreate();
|
||||||
atomicIncr(lazyfree_objects,oldsl->length,
|
atomicIncr(lazyfree_objects,oldsl->length,
|
||||||
&lazyfree_objects_mutex);
|
lazyfree_objects_mutex);
|
||||||
bioCreateBackgroundJob(BIO_LAZY_FREE,NULL,NULL,oldsl);
|
bioCreateBackgroundJob(BIO_LAZY_FREE,NULL,NULL,oldsl);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,7 +107,7 @@ void slotToKeyFlushAsync(void) {
|
|||||||
* updating the count of objects to release. */
|
* updating the count of objects to release. */
|
||||||
void lazyfreeFreeObjectFromBioThread(robj *o) {
|
void lazyfreeFreeObjectFromBioThread(robj *o) {
|
||||||
decrRefCount(o);
|
decrRefCount(o);
|
||||||
atomicDecr(lazyfree_objects,1,&lazyfree_objects_mutex);
|
atomicDecr(lazyfree_objects,1,lazyfree_objects_mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Release a database from the lazyfree thread. The 'db' pointer is the
|
/* Release a database from the lazyfree thread. The 'db' pointer is the
|
||||||
@ -119,7 +119,7 @@ void lazyfreeFreeDatabaseFromBioThread(dict *ht1, dict *ht2) {
|
|||||||
size_t numkeys = dictSize(ht1);
|
size_t numkeys = dictSize(ht1);
|
||||||
dictRelease(ht1);
|
dictRelease(ht1);
|
||||||
dictRelease(ht2);
|
dictRelease(ht2);
|
||||||
atomicDecr(lazyfree_objects,numkeys,&lazyfree_objects_mutex);
|
atomicDecr(lazyfree_objects,numkeys,lazyfree_objects_mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Release the skiplist mapping Redis Cluster keys to slots in the
|
/* Release the skiplist mapping Redis Cluster keys to slots in the
|
||||||
@ -127,5 +127,5 @@ void lazyfreeFreeDatabaseFromBioThread(dict *ht1, dict *ht2) {
|
|||||||
void lazyfreeFreeSlotsMapFromBioThread(zskiplist *sl) {
|
void lazyfreeFreeSlotsMapFromBioThread(zskiplist *sl) {
|
||||||
size_t len = sl->length;
|
size_t len = sl->length;
|
||||||
zslFree(sl);
|
zslFree(sl);
|
||||||
atomicDecr(lazyfree_objects,len,&lazyfree_objects_mutex);
|
atomicDecr(lazyfree_objects,len,lazyfree_objects_mutex);
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ void zlibc_free(void *ptr) {
|
|||||||
size_t _n = (__n); \
|
size_t _n = (__n); \
|
||||||
if (_n&(sizeof(long)-1)) _n += sizeof(long)-(_n&(sizeof(long)-1)); \
|
if (_n&(sizeof(long)-1)) _n += sizeof(long)-(_n&(sizeof(long)-1)); \
|
||||||
if (zmalloc_thread_safe) { \
|
if (zmalloc_thread_safe) { \
|
||||||
atomicIncr(used_memory,__n,&used_memory_mutex); \
|
atomicIncr(used_memory,__n,used_memory_mutex); \
|
||||||
} else { \
|
} else { \
|
||||||
used_memory += _n; \
|
used_memory += _n; \
|
||||||
} \
|
} \
|
||||||
@ -82,7 +82,7 @@ void zlibc_free(void *ptr) {
|
|||||||
size_t _n = (__n); \
|
size_t _n = (__n); \
|
||||||
if (_n&(sizeof(long)-1)) _n += sizeof(long)-(_n&(sizeof(long)-1)); \
|
if (_n&(sizeof(long)-1)) _n += sizeof(long)-(_n&(sizeof(long)-1)); \
|
||||||
if (zmalloc_thread_safe) { \
|
if (zmalloc_thread_safe) { \
|
||||||
atomicDecr(used_memory,__n,&used_memory_mutex); \
|
atomicDecr(used_memory,__n,used_memory_mutex); \
|
||||||
} else { \
|
} else { \
|
||||||
used_memory -= _n; \
|
used_memory -= _n; \
|
||||||
} \
|
} \
|
||||||
@ -202,7 +202,7 @@ size_t zmalloc_used_memory(void) {
|
|||||||
size_t um;
|
size_t um;
|
||||||
|
|
||||||
if (zmalloc_thread_safe) {
|
if (zmalloc_thread_safe) {
|
||||||
atomicGet(used_memory,um,&used_memory_mutex);
|
atomicGet(used_memory,um,used_memory_mutex);
|
||||||
} else {
|
} else {
|
||||||
um = used_memory;
|
um = used_memory;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user