mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05: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
|
||||
* lazy free list. */
|
||||
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);
|
||||
dictSetVal(db->dict,de,NULL);
|
||||
}
|
||||
@ -89,7 +89,7 @@ void emptyDbAsync(redisDb *db) {
|
||||
db->dict = dictCreate(&dbDictType,NULL);
|
||||
db->expires = dictCreate(&keyptrDictType,NULL);
|
||||
atomicIncr(lazyfree_objects,dictSize(oldht1),
|
||||
&lazyfree_objects_mutex);
|
||||
lazyfree_objects_mutex);
|
||||
bioCreateBackgroundJob(BIO_LAZY_FREE,NULL,oldht1,oldht2);
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@ void slotToKeyFlushAsync(void) {
|
||||
zskiplist *oldsl = server.cluster->slots_to_keys;
|
||||
server.cluster->slots_to_keys = zslCreate();
|
||||
atomicIncr(lazyfree_objects,oldsl->length,
|
||||
&lazyfree_objects_mutex);
|
||||
lazyfree_objects_mutex);
|
||||
bioCreateBackgroundJob(BIO_LAZY_FREE,NULL,NULL,oldsl);
|
||||
}
|
||||
|
||||
@ -107,7 +107,7 @@ void slotToKeyFlushAsync(void) {
|
||||
* updating the count of objects to release. */
|
||||
void lazyfreeFreeObjectFromBioThread(robj *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
|
||||
@ -119,7 +119,7 @@ void lazyfreeFreeDatabaseFromBioThread(dict *ht1, dict *ht2) {
|
||||
size_t numkeys = dictSize(ht1);
|
||||
dictRelease(ht1);
|
||||
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
|
||||
@ -127,5 +127,5 @@ void lazyfreeFreeDatabaseFromBioThread(dict *ht1, dict *ht2) {
|
||||
void lazyfreeFreeSlotsMapFromBioThread(zskiplist *sl) {
|
||||
size_t len = sl->length;
|
||||
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); \
|
||||
if (_n&(sizeof(long)-1)) _n += sizeof(long)-(_n&(sizeof(long)-1)); \
|
||||
if (zmalloc_thread_safe) { \
|
||||
atomicIncr(used_memory,__n,&used_memory_mutex); \
|
||||
atomicIncr(used_memory,__n,used_memory_mutex); \
|
||||
} else { \
|
||||
used_memory += _n; \
|
||||
} \
|
||||
@ -82,7 +82,7 @@ void zlibc_free(void *ptr) {
|
||||
size_t _n = (__n); \
|
||||
if (_n&(sizeof(long)-1)) _n += sizeof(long)-(_n&(sizeof(long)-1)); \
|
||||
if (zmalloc_thread_safe) { \
|
||||
atomicDecr(used_memory,__n,&used_memory_mutex); \
|
||||
atomicDecr(used_memory,__n,used_memory_mutex); \
|
||||
} else { \
|
||||
used_memory -= _n; \
|
||||
} \
|
||||
@ -202,7 +202,7 @@ size_t zmalloc_used_memory(void) {
|
||||
size_t um;
|
||||
|
||||
if (zmalloc_thread_safe) {
|
||||
atomicGet(used_memory,um,&used_memory_mutex);
|
||||
atomicGet(used_memory,um,used_memory_mutex);
|
||||
} else {
|
||||
um = used_memory;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user