Skip to content

Commit

Permalink
quickfix: ssize_t
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudwu committed Apr 18, 2014
1 parent 37233e7 commit c577a4f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions skynet-src/malloc_hook.c
Expand Up @@ -20,7 +20,7 @@ typedef struct _mem_data {

static mem_data mem_stats[SLOT_SIZE];

static size_t*
static ssize_t*
get_allocated_field(uint32_t handle) {
int h = (int)(handle & (SLOT_SIZE - 1));
mem_data *data = &mem_stats[h];
Expand All @@ -45,7 +45,7 @@ inline static void
update_xmalloc_stat_alloc(uint32_t handle, size_t __n) {
__sync_add_and_fetch(&_used_memory, __n);
__sync_add_and_fetch(&_memory_block, 1);
size_t* allocated = get_allocated_field(handle);
ssize_t* allocated = get_allocated_field(handle);
if(allocated) {
__sync_add_and_fetch(allocated, __n);
}
Expand All @@ -55,7 +55,7 @@ inline static void
update_xmalloc_stat_free(uint32_t handle, size_t __n) {
__sync_sub_and_fetch(&_used_memory, __n);
__sync_sub_and_fetch(&_memory_block, 1);
size_t* allocated = get_allocated_field(handle);
ssize_t* allocated = get_allocated_field(handle);
if(allocated) {
__sync_sub_and_fetch(allocated, __n);
}
Expand Down

0 comments on commit c577a4f

Please sign in to comment.