LO41/Objects.c

19 lines
326 B
C
Raw Normal View History

//
// Created by Antoine Bartuccio on 22/05/2018.
//
#include "Objects.h"
void *malloc_or_die(size_t size){
void *ptr = malloc(size);
2018-06-15 09:50:38 +00:00
if (ptr == NULL){
CRASH("Error allocating object");
}
return ptr;
}
2018-06-15 17:14:30 +00:00
void agent_exit(int error_code){
printf("Agent receiving code %d, exiting\n", error_code);
pthread_exit(NULL);
}