Skip to content
Extraits de code Groupes Projets
Valider 3d54b2cd rédigé par Laurent Paucot's avatar Laurent Paucot
Parcourir les fichiers

test

parent 576672fc
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Pipeline #5742 réussi
...@@ -85,7 +85,7 @@ char *get_from_buffer_1(struct buffer_rc *ptr){ // chercher dans le buffer 1 ...@@ -85,7 +85,7 @@ char *get_from_buffer_1(struct buffer_rc *ptr){ // chercher dans le buffer 1
} }
void put_in_buffer_2(struct queue *ptr, struct buffer_cw *buf){ //ajouter un element dans le buffer 2 void put_in_buffer_2(struct queue *ptr, struct buffer_cw *buf){ //ajouter un element dans le buffer 2
printf("check24\n");
buf->tab[buf->head] = malloc(sizeof(ptr)); buf->tab[buf->head] = malloc(sizeof(ptr));
buf->tab[buf->head] = ptr; buf->tab[buf->head] = ptr;
buf->len++; //augmenté l'espace occupé par le buffer buf->len++; //augmenté l'espace occupé par le buffer
...@@ -274,7 +274,7 @@ void *calculating(void *param){ ...@@ -274,7 +274,7 @@ void *calculating(void *param){
if (pr_divs == NULL){return NULL;} if (pr_divs == NULL){return NULL;}
pr_divs = prime_divs(strtoll(chaine,NULL,0)); pr_divs = prime_divs(strtoll(chaine,NULL,0));
printf("check24\n");
sem_wait(&empty2); sem_wait(&empty2);
pthread_mutex_lock(&mutex2); pthread_mutex_lock(&mutex2);
put_in_buffer_2(pr_divs,buffer_2); put_in_buffer_2(pr_divs,buffer_2);
...@@ -355,7 +355,7 @@ struct buffer_rc * buff_init_1(FILE *file1){ ...@@ -355,7 +355,7 @@ struct buffer_rc * buff_init_1(FILE *file1){
free(ptr1); free(ptr1);
return NULL;} return NULL;}
ptr1->tab = malloc(2*N*sizeof(char*)); ptr1->tab = malloc(2*N*sizeof(char*));
ptr1->size = 8; ptr1->size = 2*N;
ptr1->len = 0; ptr1->len = 0;
ptr1->head = 0; ptr1->head = 0;
ptr1->tail = 0; ptr1->tail = 0;
...@@ -373,7 +373,7 @@ struct buffer_cw * buff_init_2(FILE *file2){ ...@@ -373,7 +373,7 @@ struct buffer_cw * buff_init_2(FILE *file2){
return NULL;} return NULL;}
ptr2->tab = malloc(2*N*sizeof(struct queue*)); ptr2->tab = malloc(2*N*sizeof(struct queue*));
ptr2->size = 8; ptr2->size = 2*N;
ptr2->len = 0; ptr2->len = 0;
ptr2->head = 0; ptr2->head = 0;
ptr2->tail = 0; ptr2->tail = 0;
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter