Skip to content

Commit

Permalink
Merge pull request #5 from reqshark/calloc
Browse files Browse the repository at this point in the history
reduce allocation by a factor of 4
  • Loading branch information
marchon committed Feb 3, 2015
2 parents b00ca38 + 0d71ee4 commit 9e88ff3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void *nn_alloc_ (size_t size, const char *name)
{
uint8_t *chunk;

chunk = calloc (sizeof (struct nn_alloc_hdr) + size, sizeof(size_t));
chunk = calloc (sizeof (struct nn_alloc_hdr) + size, sizeof(uint8_t));
if (!chunk)
return NULL;

Expand Down Expand Up @@ -131,7 +131,7 @@ void nn_alloc_term (void)

void *nn_alloc_ (size_t size)
{
return calloc (size, sizeof(size_t));
return calloc (size, sizeof(uint8_t));
}

void *nn_realloc (void *ptr, size_t size)
Expand Down

0 comments on commit 9e88ff3

Please sign in to comment.