IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

C Discussion :

Malloc dans une boucle


Sujet :

C

  1. #1
    Membre confirmé
    Profil pro
    Inscrit en
    Avril 2007
    Messages
    123
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2007
    Messages : 123
    Par défaut Malloc dans une boucle
    Bonjour

    Je me pose une question toute bête à laquelle je n'ai pas trouvé de réponses:
    Si dans une boucle je fais un malloc d'un tableau de caractère
    A chaque tour de boucle je refais le malloc avec bien sur une taille différente
    Je ne fais mon free qu'apres la boucle

    Est-ce qu'il n'y a pas de risques de fuite mémoire.
    Est-ce qu'a chaque malloc l'ancienne variable est libérée?

    Par exemple

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    #include <stdio.h>   /* Pour printf et fgets */
    #include <stdlib.h>  /* Pour exit */
    #include <string.h>  /* Pour strcmp */
     
    int main(int argc, char **argv)
    {
    char * test[] = {"sdsdqsdqsdqsdqsdqsdqsr", "z", "qsdqsdsqdq", "qsdqsqs", "qsdqsdqs", "qsdqsdq", "ssssssssssssssssssssssssss",
     "asssssssssssssssss", "ssgdfghdfhdfhsgdfg", "d", "f", "dsdfsdfsdfsddsfsdfdfsdfssfdfdsddfsddfsdfsdf"};
     
    	int compteur=0;
    	int compteurNbreDefois=0;
    	int tailleLigneFinal;
    	char* ligneFinal;	//tableau content le nom + la ligne
    	char ligne [100];
    	char nom[10];
     
    	strcpy(nom,"test");
    	strcat(nom," >");		// concatenation d'un prompt > dans nom
     
     	do
    	{
    		strcpy(ligne,test[compteur]);
     
    		tailleLigneFinal=strlen(ligne)+strlen(nom);
     
    		ligneFinal=malloc((tailleLigneFinal+1)*sizeof(char));	//creation d un tableau de mot de la taille du nom
    									// et de la ligne rentree +1
    		if(ligneFinal==NULL)	//si l allocation echoue
    		{
    			perror("echec de l'allocation");		
    			exit(EXIT_FAILURE);
    		}
     
    		sprintf(ligneFinal,"%s %s",nom,ligne);	//concatenation dans ligneFinal du nom et de la ligne
    		printf(ligneFinal);
    		printf("\n");
     
    		if(compteur==11)
    		{
    			compteur=0;
    		}
    		else
    		{
    			compteur++;	
    		}
    		compteurNbreDefois++;
    	}
    	while(compteurNbreDefois!=1000000);
    	free(ligneFinal);
    Merci d'avance de vos réponses

  2. #2
    Membre éprouvé
    Avatar de granquet
    Profil pro
    Étudiant
    Inscrit en
    Octobre 2005
    Messages
    1 201
    Détails du profil
    Informations personnelles :
    Localisation : France, Pyrénées Orientales (Languedoc Roussillon)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Octobre 2005
    Messages : 1 201
    Par défaut
    le man de malloc dis clairement
    Citation Envoyé par man malloc
    malloc() alloue size octets, et renvoie un pointeur sur la mémoire allouée.
    donc à priori tu peux te douter que tu fait une allocation à chaque appel ... sans rien libérer.
    ensuite, t'aurais pu te douter que malloc n'étais pas capable de libérer cet espace car il ne connais pas la valeur précédente du pointeur ...

  3. #3
    Membre émérite
    Profil pro
    Inscrit en
    Mars 2005
    Messages
    865
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2005
    Messages : 865
    Par défaut
    Oui effectivement, il y a une belle fuite mémoire...
    Tu peux utiliser realloc pour changer la taille du bloc mémoire. Lis bien la page suivante.
    http://man.developpez.com/man3/realloc.3.php

    Il est préférable de faire ceci pour pouvoir facilement changer le type de ligneFinal (même chose pour realloc).
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    ligneFinal=malloc((tailleLigneFinal+1) * sizeof *ligneFinal);
    N'oublie pas le return 0 à la fin.

  4. #4
    Membre confirmé
    Profil pro
    Inscrit en
    Avril 2007
    Messages
    123
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2007
    Messages : 123
    Par défaut
    Ok donc si j'ai bien compris le man:

    -Lors du premier tour de boucle le realloc va se comporter comme un malloc associant un pointeur sur ligneFinal car mon ligneFinal est initialisé à null

    -Lors des tours de boucle suivant il va changer la taille pointée par ligneFinal et donc se débrouiller pour gérer la mémoire

    -Après ma boucle je libère ligneFinal donc normalement ca marche.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    #include <stdio.h>   /* Pour printf et fgets */
    #include <stdlib.h>  /* Pour exit */
    #include <string.h>  /* Pour strcmp */
     
    int main(int argc, char **argv)
    {
     
    	char * test[] = {"c", "xxxxxxxxxxxxxxxxx", "qsdqsdsqdq", "qsdqsqs", "qsdqsdqs", "qsdqsdq",
               "ssssssssssssssssssssssssss", "asssssssssssssssss", 
    "ssgdfghdfhdfhsgdfg", "d", "f",
    "dsdfsdfsdfsddsfsdfdfsdfssfdfdsdfsdfsddfsdfsdf"};
     
    	int compteur=0;
    	int compteurNbreDefois=0;
    	int tailleLigneFinal=0;
    	char* ligneFinal=NULL;	//tableau content le nom + la ligne
    	char ligne [100];
    	char nom[10];
     
    	strcpy(nom,"test");
     
    	strcat(nom," >");		// concatenation d'un prompt > dans nom
     
    	ligneFinal=NULL;
     
     	do
    	{
    		strcpy(ligne,test[compteur]);
     
    		tailleLigneFinal=strlen(ligne)+strlen(nom)+1;
     
    		ligneFinal=realloc(ligneFinal,(tailleLigneFinal+1)*sizeof *ligneFinal);	//creation d un tableau de mot de la taille du nom
    									// et de la ligne rentree +1
    		if(ligneFinal==NULL)	//si l allocation echoue
    		{
    			perror("echec de l'allocation");		
    			exit(EXIT_FAILURE);
    		}
     
    		sprintf(ligneFinal,"%s %s",nom,ligne);	//concatenation dans ligneFinal du nom et de la ligne
    		printf(ligneFinal);
    		printf("\n");
     
     
    		if(compteur==11)
    		{
    			compteur=0;
    		}
    		else
    		{
    			compteur++;	
    		}
    		compteurNbreDefois++;
     
    	}
    	while(compteurNbreDefois!=1000000);
     
    free(ligneFinal);
    return 0;
     
    }

  5. #5
    Expert confirmé

    Profil pro
    Inscrit en
    Janvier 2007
    Messages
    10 610
    Détails du profil
    Informations personnelles :
    Âge : 67
    Localisation : France

    Informations forums :
    Inscription : Janvier 2007
    Messages : 10 610
    Billets dans le blog
    2
    Par défaut
    Exactement..

    Sauf qu'il y 2 subtilites :


    1. Si le realloc echoue a la nieme fois, cela n'aura pas libere ta memoire, et tu ne pourras plus la retrouver (ton pointeur sera a NULL)

      Donc il vaut mieux passer par une variable temporaire :

      Code : Sélectionner tout - Visualiser dans une fenêtre à part
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      char *ligne_finale;
      char *tmp ;
       
      ...
       
      tmp = realloc (ligne_finale, ... );
      if ( tmp != NULL )
          ligne_finale = tmp ;
       
      ....
       
      if ( ligne_finale != NULL )
        free(ligne_finale);
    2. Deuxieme subtilite, le realloc essaye de trouver un bloc d'un seul tenant de la taille demandee.

      Si par consequent tu fais BEAUCOUP de realloc de tailles tres variables, tu vas creer des TROUS dans ta memoire (non recuperables, en tous cas non totalement) et ta memoire globale va croitre au cours du temps. Donc ceci est bien pour soit des petits tableaux (dont tu sais que, meme si ils se deplacent, l'espace sera a peu pres occupe par une autre allocation, ailleurs), soit pour des "petites" reallocations.

  6. #6
    Membre prolifique
    Avatar de Sve@r
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Février 2006
    Messages
    12 801
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Oise (Picardie)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : Aéronautique - Marine - Espace - Armement

    Informations forums :
    Inscription : Février 2006
    Messages : 12 801
    Billets dans le blog
    1
    Par défaut
    Citation Envoyé par souviron34 Voir le message
    Si par consequent tu fais BEAUCOUP de realloc de tailles tres variables, tu vas creer des TROUS dans ta memoire (non recuperables, en tous cas non totalement) et ta memoire globale va croitre au cours du temps. Donc ceci est bien pour soit des petits tableaux (dont tu sais que, meme si ils se deplacent, l'espace sera a peu pres occupe par une autre allocation, ailleurs), soit pour des "petites" reallocations.
    Et d'ailleurs il existe divers débats sur la meilleure façon de faire de la réallocation. Certains préfèrent réallouer quand c'est nécessaire un "gros" espace (puis le remplir petit à petit à chaque itération), certains préfèrent réallouer un "petit" espace, certains réallouent juste ce qu'il faut (ce que tu fais dans ta boucle => à chaque itération tu réalloues un de plus). J'ai même vu une fois quuelqu'un conseiller de réallouer, quand c'est nécessaire, deux fois l'espace précédemment alloué (la zone double donc à chaque réallocation). Bref, bien gérer la mémoire en C c'est du boulot...
    Mon Tutoriel sur la programmation «Python»
    Mon Tutoriel sur la programmation «Shell»
    Sinon il y en a pleins d'autres. N'oubliez pas non plus les différentes faq disponibles sur ce site
    Et on poste ses codes entre balises [code] et [/code]

  7. #7
    Rédacteur/Modérateur
    Avatar de Trap D
    Profil pro
    Inscrit en
    Septembre 2003
    Messages
    4 942
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2003
    Messages : 4 942
    Par défaut
    La "bonne valeur" pour le realloc est paraît-il le nombre d'or !
    "La haine seule fait des choix" - Koan Zen
    "Il ne faut pas être meilleur que les autres, il faut être meilleur que soi." Albert Jacquard
    "Ceux qui savent où ils ont posé leur parapluie ne sont pas alcooliques." - pgibonne.
    Faites du Prolog, ça vous changera les idées !
    Ma page Prolog
    Mes codes sources commentés

    Mon avatar : La Madeleine à la veilleuse de Georges de La Tour

  8. #8
    Membre éprouvé
    Avatar de granquet
    Profil pro
    Étudiant
    Inscrit en
    Octobre 2005
    Messages
    1 201
    Détails du profil
    Informations personnelles :
    Localisation : France, Pyrénées Orientales (Languedoc Roussillon)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Octobre 2005
    Messages : 1 201
    Par défaut
    Citation Envoyé par Trap D Voir le message
    La "bonne valeur" pour le realloc est paraît-il le nombre d'or !
    un petit papier de Jean-Marc avec un peu plus de détails:
    http://www.bourguet.org/realloc.pdf

  9. #9
    Expert éminent
    Avatar de Emmanuel Delahaye
    Profil pro
    Retraité
    Inscrit en
    Décembre 2003
    Messages
    14 512
    Détails du profil
    Informations personnelles :
    Âge : 68
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Retraité

    Informations forums :
    Inscription : Décembre 2003
    Messages : 14 512
    Par défaut
    Citation Envoyé par Anonymouse Voir le message
    Je me pose une question toute bête à laquelle je n'ai pas trouvé de réponses:
    Si dans une boucle je fais un malloc d'un tableau de caractère
    A chaque tour de boucle je refais le malloc avec bien sur une taille différente
    Je ne fais mon free qu'apres la boucle

    Est-ce qu'il n'y a pas de risques de fuite mémoire.
    Est-ce qu'a chaque malloc l'ancienne variable est libérée?
    Par quel miracle ? Réfléchis un peu plus. Comment malloc() pourrait-t-il prendre l'initiative de libérer quoique ce soit ? Grâce à quel paramètre ? C'est pas de la magie l'informatique, c'est d'abord du bon sens...

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
     
    SYSALLOC Bloc 7E860108 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7E860120 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7E860138 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7E860168 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7E860190 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7E8601B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7E8601C8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F040048 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F040088 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F0400B0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F0400C0 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F0400E0 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F0400F8 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F040110 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F040128 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F040158 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F040180 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F0401A8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F0401B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F0401C8 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F040208 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F040230 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F0048 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F0068 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F0080 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F0098 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F00B0 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F00E0 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F0108 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F0130 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F0140 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F0150 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F0190 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F01B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F01C8 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F01E8 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F0200 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F0218 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F0230 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F0260 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F0288 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F02B0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77870048 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77870058 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77870098 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 778700C0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 778700D0 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 778700F0 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77870108 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77870120 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77870138 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77870168 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77870190 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 778701B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 778701C8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F440048 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F440088 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F4400B0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F4400C0 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F4400E0 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F4400F8 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F440110 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F440128 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F440158 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F440180 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F4401A8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F4401B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F4401C8 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F440208 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F440230 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF0048 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF0068 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF0080 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF0098 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF00B0 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF00E0 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF0108 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF0130 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF0140 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF0150 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF0190 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF01B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF01C8 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF01E8 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF0200 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF0218 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF0230 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF0260 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF0288 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF02B0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77A70048 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77A70058 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77A70098 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77A700C0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77A700D0 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77A700F0 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77A70108 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77A70120 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77A70138 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77A70168 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77A70190 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77A701B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77A701C8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FDF0048 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FDF0088 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FDF00B0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FDF00C0 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FDF00E0 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FDF00F8 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FDF0110 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FDF0128 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FDF0158 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FDF0180 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FDF01A8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FDF01B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FDF01C8 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FDF0208 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FDF0230 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C710048 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C710068 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C710080 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C710098 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7100B0 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7100E0 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C710108 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C710130 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C710140 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C710150 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C710190 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7101B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7101C8 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7101E8 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C710200 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C710218 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C710230 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C710260 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C710288 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7102B0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F640048 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F640058 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F640098 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6400C0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6400D0 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6400F0 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F640108 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F640120 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F640138 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F640168 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F640190 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6401B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6401C8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FEF0048 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FEF0088 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FEF00B0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FEF00C0 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FEF00E0 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FEF00F8 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FEF0110 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FEF0128 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FEF0158 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FEF0180 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FEF01A8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FEF01B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FEF01C8 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FEF0208 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FEF0230 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B70048 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B70068 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B70080 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B70098 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B700B0 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B700E0 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B70108 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B70130 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B70140 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B70150 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B70190 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B701B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B701C8 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B701E8 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B70200 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B70218 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B70230 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B70260 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B70288 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B702B0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C790048 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C790058 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C790098 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7900C0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7900D0 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7900F0 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C790108 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C790120 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C790138 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C790168 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C790190 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7901B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7901C8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FF70048 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FF70088 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FF700B0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FF700C0 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FF700E0 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FF700F8 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FF70110 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FF70128 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FF70158 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FF70180 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FF701A8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FF701B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FF701C8 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FF70208 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FF70230 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC0048 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC0068 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC0080 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC0098 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC00B0 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC00E0 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC0108 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC0130 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC0140 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC0150 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC0190 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC01B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC01C8 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC01E8 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC0200 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC0218 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC0230 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC0260 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC0288 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC02B0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7D0048 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7D0058 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7D0098 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7D00C0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7D00D0 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7D00F0 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7D0108 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7D0120 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7D0138 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7D0168 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7D0190 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7D01B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7D01C8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6C0048 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6C0088 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6C00B0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6C00C0 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6C00E0 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6C00F8 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6C0110 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6C0128 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6C0158 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6C0180 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6C01A8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6C01B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6C01C8 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6C0208 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6C0230 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F0048 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F0068 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F0080 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F0098 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F00B0 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F00E0 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F0108 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F0130 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F0140 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F0150 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F0190 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F01B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F01C8 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F01E8 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F0200 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F0218 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F0230 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F0260 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F0288 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F02B0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6E0048 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6E0058 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6E0098 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6E00C0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6E00D0 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6E00F0 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6E0108 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6E0120 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6E0138 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6E0168 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6E0190 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6E01B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6E01C8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Released Memory
    FRMWRK.Execution terminated
     
    Press ENTER to continue.
    T'as fait fort !
    http://emmanuel-delahaye.developpez.com/sysalloc_um.htm

  10. #10
    Expert éminent
    Avatar de Emmanuel Delahaye
    Profil pro
    Retraité
    Inscrit en
    Décembre 2003
    Messages
    14 512
    Détails du profil
    Informations personnelles :
    Âge : 68
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Retraité

    Informations forums :
    Inscription : Décembre 2003
    Messages : 14 512
    Par défaut
    Citation Envoyé par Anonymouse Voir le message
    Ok donc si j'ai bien compris le man:

    -Lors du premier tour de boucle le realloc va se comporter comme un malloc associant un pointeur sur ligneFinal car mon ligneFinal est initialisé à null

    -Lors des tours de boucle suivant il va changer la taille pointée par ligneFinal et donc se débrouiller pour gérer la mémoire

    -Après ma boucle je libère ligneFinal donc normalement ca marche.
    C'est long...

    OK, ça marche :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
     
    <...>
    test > qsdqsqs
    test > qsdqsdqs
    test > qsdqsdq
    test > ssssssssssssssssssssssssss
    test > asssssssssssssssss
    test > ssgdfghdfhdfhsgdfg
    test > d
    test > f
    test > dsdfsdfsdfsddsfsdfdfsdfssfdfdsdfsdfsddfsdfsdf
    test > c
    test > xxxxxxxxxxxxxxxxx
    test > qsdqsdsqdq
    test > qsdqsqs
    test > qsdqsdqs
    test > qsdqsdq
    test > ssssssssssssssssssssssssss
    test > asssssssssssssssss
    test > ssgdfghdfhdfhsgdfg
    test > d
    test > f
    test > dsdfsdfsdfsddsfsdfdfsdfssfdfdsdfsdfsddfsdfsdf
    test > c
    test > xxxxxxxxxxxxxxxxx
    test > qsdqsdsqdq
    test > qsdqsqs
    done in 101.141 s
    SYSALLOC min=4294967295 max=4294967295 delta=0
    SYSALLOC All-matched
    SYSALLOC Released Memory
    FRMWRK.Execution terminated
     
    Press ENTER to continue.

  11. #11
    Membre confirmé
    Profil pro
    Inscrit en
    Avril 2007
    Messages
    123
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2007
    Messages : 123
    Par défaut
    Citation Envoyé par souviron34 Voir le message
    Exactement..

    Sauf qu'il y 2 subtilites :

    1. Si le realloc echoue a la nieme fois, cela n'aura pas libere ta memoire, et tu ne pourras plus la retrouver (ton pointeur sera a NULL)

      Donc il vaut mieux passer par une variable temporaire :

      Code : Sélectionner tout - Visualiser dans une fenêtre à part
      1
      2
      3
      4
      5
      6
      7
      8
      9
      char *ligne_finale;
      char *tmp ;
      ...
      tmp = realloc (ligne_finale, ... );
      if ( tmp != NULL )
          ligne_finale = tmp ;
      ....
      if ( ligne_finale != NULL )
        free(ligne_finale);
    2. Deuxieme subtilite, le realloc essaye de trouver un bloc d'un seul tenant de la taille demandee.

      Si par consequent tu fais BEAUCOUP de realloc de tailles tres variables, tu vas creer des TROUS dans ta memoire (non recuperables, en tous cas non totalement) et ta memoire globale va croitre au cours du temps. Donc ceci est bien pour soit des petits tableaux (dont tu sais que, meme si ils se deplacent, l'espace sera a peu pres occupe par une autre allocation, ailleurs), soit pour des "petites" reallocations.
    Ok je vais utiliser une variable temporire pour gérer les cas ou l'allocation ne marche pas

    Citation Envoyé par Sve@r Voir le message
    Et d'ailleurs il existe divers débats sur la meilleure façon de faire de la réallocation. Certains préfèrent réallouer quand c'est nécessaire un "gros" espace (puis le remplir petit à petit à chaque itération), certains préfèrent réallouer un "petit" espace, certains réallouent juste ce qu'il faut (ce que tu fais dans ta boucle => à chaque itération tu réalloues un de plus). J'ai même vu une fois quuelqu'un conseiller de réallouer, quand c'est nécessaire, deux fois l'espace précédemment alloué (la zone double donc à chaque réallocation). Bref, bien gérer la mémoire en C c'est du boulot...
    Pour l'instant je vais continuer comme j'ai fait je pense que mon programme allouera a peu près la même taille a chaque fois évitant ainsi de perdre trop de RAM;

    Citation Envoyé par Emmanuel Delahaye Voir le message
    Par quel miracle ? Réfléchis un peu plus. Comment malloc() pourrait-t-il prendre l'initiative de libérer quoique ce soit ? Grâce à quel paramètre ? C'est pas de la magie l'informatique, c'est d'abord du bon sens...

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
     
    SYSALLOC Bloc 7E860108 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7E860120 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7E860138 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7E860168 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7E860190 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7E8601B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7E8601C8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F040048 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F040088 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F0400B0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F0400C0 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F0400E0 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F0400F8 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F040110 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F040128 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F040158 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F040180 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F0401A8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F0401B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F0401C8 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F040208 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F040230 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F0048 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F0068 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F0080 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F0098 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F00B0 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F00E0 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F0108 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F0130 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F0140 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F0150 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F0190 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F01B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F01C8 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F01E8 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F0200 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F0218 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F0230 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F0260 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F0288 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F7F02B0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77870048 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77870058 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77870098 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 778700C0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 778700D0 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 778700F0 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77870108 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77870120 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77870138 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77870168 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77870190 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 778701B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 778701C8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F440048 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F440088 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F4400B0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F4400C0 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F4400E0 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F4400F8 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F440110 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F440128 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F440158 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F440180 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F4401A8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F4401B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F4401C8 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F440208 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F440230 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF0048 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF0068 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF0080 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF0098 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF00B0 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF00E0 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF0108 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF0130 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF0140 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF0150 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF0190 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF01B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF01C8 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF01E8 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF0200 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF0218 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF0230 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF0260 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF0288 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FBF02B0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77A70048 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77A70058 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77A70098 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77A700C0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77A700D0 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77A700F0 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77A70108 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77A70120 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77A70138 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77A70168 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77A70190 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77A701B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77A701C8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FDF0048 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FDF0088 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FDF00B0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FDF00C0 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FDF00E0 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FDF00F8 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FDF0110 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FDF0128 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FDF0158 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FDF0180 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FDF01A8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FDF01B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FDF01C8 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FDF0208 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FDF0230 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C710048 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C710068 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C710080 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C710098 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7100B0 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7100E0 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C710108 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C710130 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C710140 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C710150 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C710190 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7101B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7101C8 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7101E8 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C710200 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C710218 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C710230 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C710260 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C710288 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7102B0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F640048 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F640058 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F640098 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6400C0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6400D0 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6400F0 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F640108 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F640120 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F640138 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F640168 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F640190 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6401B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6401C8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FEF0048 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FEF0088 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FEF00B0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FEF00C0 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FEF00E0 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FEF00F8 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FEF0110 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FEF0128 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FEF0158 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FEF0180 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FEF01A8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FEF01B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FEF01C8 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FEF0208 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FEF0230 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B70048 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B70068 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B70080 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B70098 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B700B0 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B700E0 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B70108 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B70130 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B70140 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B70150 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B70190 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B701B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B701C8 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B701E8 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B70200 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B70218 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B70230 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B70260 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B70288 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77B702B0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C790048 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C790058 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C790098 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7900C0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7900D0 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7900F0 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C790108 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C790120 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C790138 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C790168 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C790190 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7901B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7901C8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FF70048 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FF70088 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FF700B0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FF700C0 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FF700E0 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FF700F8 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FF70110 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FF70128 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FF70158 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FF70180 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FF701A8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FF701B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FF701C8 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FF70208 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7FF70230 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC0048 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC0068 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC0080 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC0098 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC00B0 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC00E0 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC0108 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC0130 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC0140 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC0150 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC0190 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC01B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC01C8 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC01E8 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC0200 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC0218 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC0230 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC0260 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC0288 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 77BC02B0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7D0048 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7D0058 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7D0098 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7D00C0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7D00D0 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7D00F0 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7D0108 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7D0120 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7D0138 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7D0168 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7D0190 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7D01B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7D01C8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6C0048 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6C0088 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6C00B0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6C00C0 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6C00E0 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6C00F8 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6C0110 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6C0128 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6C0158 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6C0180 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6C01A8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6C01B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6C01C8 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6C0208 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6C0230 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F0048 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F0068 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F0080 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F0098 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F00B0 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F00E0 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F0108 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F0130 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F0140 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F0150 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F0190 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F01B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F01C8 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F01E8 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F0200 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F0218 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F0230 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F0260 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F0288 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7C7F02B0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6E0048 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6E0058 (50 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6E0098 (29 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6E00C0 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6E00D0 (17 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6E00F0 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6E0108 (15 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6E0120 (14 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6E0138 (33 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6E0168 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6E0190 (25 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6E01B8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Bloc 7F6E01C8 (8 bytes) malloc'ed at line 30 of 'main.c' not freed
    SYSALLOC Released Memory
    FRMWRK.Execution terminated
     
    Press ENTER to continue.
    T'as fait fort !
    http://emmanuel-delahaye.developpez.com/sysalloc_um.htm
    Ok je vais jeter un coup d'œuil sur SYSALLOc c'est exactement ce dont j'avais besoin pour tester les différentes allocations de mon programme.

    Merci de vos réponses

  12. #12
    Membre émérite
    Profil pro
    Inscrit en
    Mars 2005
    Messages
    865
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2005
    Messages : 865
    Par défaut
    Citation Envoyé par Anonymouse Voir le message
    Pour l'instant je vais continuer comme j'ai fait je pense que mon programme allouera a peu près la même taille a chaque fois évitant ainsi de perdre trop de RAM;
    Tu ne devrais réallouer que si la taille de ta zone mémoire est trop petite. Inutile de réallouer si la zone mémoire en cours est suffisamment grande pour contenir ta nouvelle chaîne.

  13. #13
    Membre confirmé
    Profil pro
    Inscrit en
    Avril 2007
    Messages
    123
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2007
    Messages : 123
    Par défaut
    Citation Envoyé par aoyou Voir le message
    Tu ne devrais réallouer que si la taille de ta zone mémoire est trop petite. Inutile de réallouer si la zone mémoire en cours est suffisamment grande pour contenir ta nouvelle chaîne.
    C'est une bonne idée que je vais suivre
    Merci

  14. #14
    Membre prolifique
    Avatar de Sve@r
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Février 2006
    Messages
    12 801
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Oise (Picardie)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : Aéronautique - Marine - Espace - Armement

    Informations forums :
    Inscription : Février 2006
    Messages : 12 801
    Billets dans le blog
    1
    Par défaut
    Citation Envoyé par Anonymouse Voir le message
    C'est une bonne idée que je vais suivre
    Merci
    Mouais. De toute façon, je crois que quand on demande un realloc plus petit, il ne se passe rien...
    Mon Tutoriel sur la programmation «Python»
    Mon Tutoriel sur la programmation «Shell»
    Sinon il y en a pleins d'autres. N'oubliez pas non plus les différentes faq disponibles sur ce site
    Et on poste ses codes entre balises [code] et [/code]

  15. #15
    Expert éminent
    Avatar de Emmanuel Delahaye
    Profil pro
    Retraité
    Inscrit en
    Décembre 2003
    Messages
    14 512
    Détails du profil
    Informations personnelles :
    Âge : 68
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Retraité

    Informations forums :
    Inscription : Décembre 2003
    Messages : 14 512
    Par défaut
    Citation Envoyé par Sve@r Voir le message
    Mouais. De toute façon, je crois que quand on demande un realloc plus petit, il ne se passe rien...
    Ca dépend du système et de la différence de taille... De toutes façons, on n'en saura jamais rien et il ne faut pas faire d'hypothèses hasardeuses. La taille disponible est celle qui a été signalée à realloc() et rien d'autre.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [langage] incrementation de variable dans une boucle
    Par mimilou dans le forum Langage
    Réponses: 15
    Dernier message: 16/04/2004, 13h23
  2. Problème avec TNMSMTP dans une boucle.
    Par Orgied dans le forum Web & réseau
    Réponses: 3
    Dernier message: 07/04/2004, 10h19
  3. swf dans une boucle asp
    Par Chucky69 dans le forum Flash
    Réponses: 11
    Dernier message: 10/02/2004, 17h07
  4. [Vb.net] Indexé un objet crée dans une boucle
    Par picpic dans le forum Windows Forms
    Réponses: 10
    Dernier message: 17/12/2003, 14h37
  5. Pause dans une boucle
    Par HT dans le forum Langage
    Réponses: 4
    Dernier message: 03/06/2003, 08h52

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo