mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-20 09:34:19 +00:00
fixed small errors in memheap
This commit is contained in:
parent
2d4824efd5
commit
f63bcc8673
|
@ -39,12 +39,12 @@ static CHUNK *memheap_newchunk()
|
|||
}
|
||||
|
||||
/******************/
|
||||
static void *memheap_allocate_from_chunk(CHUNK *chunk, int size)
|
||||
static void *memheap_allocate_from_chunk(CHUNK *chunk, unsigned int size)
|
||||
{
|
||||
char *mem;
|
||||
|
||||
/* check if we need can fit the allocation */
|
||||
if(chunk->current + size >= chunk->end)
|
||||
if(chunk->current + size > chunk->end)
|
||||
return (void*)0x0;
|
||||
|
||||
/* get memory and move the pointer forward */
|
||||
|
@ -81,7 +81,7 @@ void memheap_destroy(HEAP *heap)
|
|||
}
|
||||
|
||||
/* */
|
||||
void *memheap_allocate(HEAP *heap, int size)
|
||||
void *memheap_allocate(HEAP *heap, unsigned int size)
|
||||
{
|
||||
char *mem;
|
||||
|
||||
|
|
|
@ -3,4 +3,4 @@
|
|||
typedef struct HEAP_t HEAP;
|
||||
HEAP *memheap_create();
|
||||
void memheap_destroy(HEAP *heap);
|
||||
void *memheap_allocate(HEAP *heap, int size);
|
||||
void *memheap_allocate(HEAP *heap, unsigned int size);
|
||||
|
|
Loading…
Reference in a new issue