mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 20:23:06 +00:00
bugfix: SLOT_SIZE should be 64K
This commit is contained in:
@@ -15,14 +15,14 @@ typedef struct _mem_data {
|
|||||||
size_t allocated;
|
size_t allocated;
|
||||||
} mem_data;
|
} mem_data;
|
||||||
|
|
||||||
#define SLOT_SIZE 0xffff
|
#define SLOT_SIZE 0x10000
|
||||||
#define PREFIX_SIZE sizeof(uint32_t)
|
#define PREFIX_SIZE sizeof(uint32_t)
|
||||||
|
|
||||||
static mem_data mem_stats[SLOT_SIZE];
|
static mem_data mem_stats[SLOT_SIZE];
|
||||||
|
|
||||||
static size_t*
|
static size_t*
|
||||||
get_allocated_field(handle) {
|
get_allocated_field(handle) {
|
||||||
int h = (handle & SLOT_SIZE) - 1;
|
int h = (handle & (SLOT_SIZE - 1));
|
||||||
mem_data *data = &mem_stats[h];
|
mem_data *data = &mem_stats[h];
|
||||||
if(data->handle == 0 || data->allocated == 0) {
|
if(data->handle == 0 || data->allocated == 0) {
|
||||||
__sync_synchronize();
|
__sync_synchronize();
|
||||||
|
|||||||
Reference in New Issue
Block a user