@@ -58,13 +58,13 @@ struct SwiftNetMemoryAllocator allocator_create(const uint32_t item_size, const
5858 void * const stack_allocated_memory = malloc (chunk_item_amount * sizeof (void * ));
5959
6060 if (unlikely (allocated_memory == NULL || stack_allocated_memory == NULL )) {
61- fprintf ( stderr , "Failed to allocate memory\n " );
61+ PRINT_ERROR ( "Failed to allocate memory" );
6262 exit (EXIT_FAILURE );
6363 }
6464
6565 struct SwiftNetMemoryAllocatorStack * const first_stack_pointers = malloc (sizeof (struct SwiftNetMemoryAllocatorStack ));
6666 if (unlikely (first_stack_pointers == NULL )) {
67- fprintf ( stderr , "Failed to allocate memory\n " );
67+ PRINT_ERROR ( "Failed to allocate memory" );
6868 exit (EXIT_FAILURE );
6969 }
7070
@@ -76,7 +76,7 @@ struct SwiftNetMemoryAllocator allocator_create(const uint32_t item_size, const
7676
7777 struct SwiftNetMemoryAllocatorStack * const first_stack_data = malloc (sizeof (struct SwiftNetMemoryAllocatorStack ));
7878 if (unlikely (first_stack_data == NULL )) {
79- fprintf ( stderr , "Failed to allocate memory\n " );
79+ PRINT_ERROR ( "Failed to allocate memory" );
8080 exit (EXIT_FAILURE );
8181 }
8282
@@ -124,13 +124,13 @@ static void create_new_stack(struct SwiftNetMemoryAllocator* const memory_alloca
124124 void * const allocated_memory = malloc (memory_allocator -> item_size * chunk_item_amount );
125125 void * const stack_allocated_memory = malloc (chunk_item_amount * sizeof (void * ));
126126 if (unlikely (allocated_memory == NULL || stack_allocated_memory == NULL )) {
127- fprintf ( stderr , "Failed to allocate memory\n " );
127+ PRINT_ERROR ( "Failed to allocate memory" );
128128 exit (EXIT_FAILURE );
129129 }
130130
131131 struct SwiftNetMemoryAllocatorStack * const stack_pointers = malloc (sizeof (struct SwiftNetMemoryAllocatorStack ));
132132 if (unlikely (stack_pointers == NULL )) {
133- fprintf ( stderr , "Failed to allocate memory\n " );
133+ PRINT_ERROR ( "Failed to allocate memory" );
134134 exit (EXIT_FAILURE );
135135 }
136136
@@ -142,7 +142,7 @@ static void create_new_stack(struct SwiftNetMemoryAllocator* const memory_alloca
142142
143143 struct SwiftNetMemoryAllocatorStack * const stack_data = malloc (sizeof (struct SwiftNetMemoryAllocatorStack ));
144144 if (unlikely (stack_data == NULL )) {
145- fprintf ( stderr , "Failed to allocate memory\n " );
145+ PRINT_ERROR ( "Failed to allocate memory" );
146146 exit (EXIT_FAILURE );
147147 }
148148
@@ -204,7 +204,7 @@ void allocator_free(struct SwiftNetMemoryAllocator* const memory_allocator, void
204204 const bool already_free = is_already_free (memory_allocator , memory_location );
205205
206206 if (already_free == true) {
207- fprintf ( stderr , "Pointer %p has already been freed\n " , memory_location );
207+ PRINT_ERROR ( "Pointer %p has already been freed" , memory_location );
208208 exit (EXIT_FAILURE );
209209 }
210210 #endif
0 commit comments