Fixed potential warnings in the arena allocator
This commit is contained in:
parent
dcbd9555d5
commit
545295af9d
|
@ -1,4 +1,8 @@
|
||||||
#include <alloc/arena.h>
|
#include <librr/alloc/arena.h>
|
||||||
|
#include <librr/strutil.h>
|
||||||
|
#include <librr/memory.h>
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
rr_arena_s rr_new_arena(usz_t capacity)
|
rr_arena_s rr_new_arena(usz_t capacity)
|
||||||
{
|
{
|
||||||
|
@ -28,7 +32,7 @@ void * rr_arena_alloc(rr_arena_s *arena, usz_t length)
|
||||||
return block;
|
return block;
|
||||||
}
|
}
|
||||||
|
|
||||||
char * rr_arena_clone_string(rr_arena_s *arena, char *string)
|
char * rr_arena_clone_string(rr_arena_s *arena, const char *string)
|
||||||
{
|
{
|
||||||
usz_t len_string = rr_measure_string(string);
|
usz_t len_string = rr_measure_string(string);
|
||||||
char *cloned_string = rr_arena_alloc(arena, len_string+1);
|
char *cloned_string = rr_arena_alloc(arena, len_string+1);
|
||||||
|
|
Loading…
Reference in New Issue