Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillsaidov committed Jun 30, 2024
1 parent 3f6e5db commit c18e0b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/vita/allocator/mallocator.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ vt_mallocator_t *vt_mallocator_create(void) {
// initialize object list
*alloctr = (vt_mallocator_t) {
.obj_list = VT_CALLOC(sizeof(struct VitaAllocatedObject) * VT_ARRAY_DEFAULT_INIT_ELEMENTS),
.obj_list_capacity = VT_ARRAY_DEFAULT_INIT_ELEMENTS
.obj_list_capacity = VT_ARRAY_DEFAULT_INIT_ELEMENTS,
};

// set up functions
Expand Down
14 changes: 7 additions & 7 deletions tests/src/test_mallocator.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
int32_t main(void) {
vt_mallocator_t *alloctr = vt_mallocator_create();

int *val = VT_ALLOCATOR_ALLOC(alloctr, sizeof(int));
char *zbuf = VT_ALLOCATOR_ALLOC(alloctr, sizeof(char) * 100);
// int *val = VT_ALLOCATOR_ALLOC(alloctr, sizeof(int));
// char *zbuf = VT_ALLOCATOR_ALLOC(alloctr, sizeof(char) * 100);

VT_ALLOCATOR_FREE(alloctr, zbuf);
zbuf = VT_ALLOCATOR_ALLOC(alloctr, 210);
// vt_mallocator_print_stats(alloctr->stats);
// VT_ALLOCATOR_FREE(alloctr, zbuf);
// zbuf = VT_ALLOCATOR_ALLOC(alloctr, 210);
// // vt_mallocator_print_stats(alloctr->stats);

VT_ALLOCATOR_FREE(alloctr, val);
VT_ALLOCATOR_FREE(alloctr, zbuf);
// VT_ALLOCATOR_FREE(alloctr, val);
// VT_ALLOCATOR_FREE(alloctr, zbuf);

// vt_mallocator_print_stats(alloctr->stats);
vt_mallocator_destroy(alloctr);
Expand Down

0 comments on commit c18e0b6

Please sign in to comment.