tsp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tsp-devel] Précisions sur tsp_hash.[ch ]


From: PAGNOT, Robert
Subject: [Tsp-devel] Précisions sur tsp_hash.[ch ]
Date: Tue, 29 Nov 2005 08:55:51 +0100

line 222 : free(hash) ?

Pour cela, il aurait fallu :

int hash_close(hash_t **hash)
        ...
        free(*hash)
        *hash = NULL
        ...

Je faisais cela par l'appellant.
        ...
        hash_close(p)
        free(p)
        p = NULL
        ...

Si tu estimes nécessaire, go-ahead pour les modifs !!!


MT-Safe : a part le FIXME indiqué, le code est reentrant mais pas totalement MT-Safe (je ne sais pas ce que cela fait si tu fais un hash_get pendant qu'un autre thread fait un hash_append sur la même hash_table !!!).

Ceci étant, vaut mieux que la table soit "statique" : on fait tous les hash_append qui vont bien (car il y a des calloc's) au démarrage, puis on ne fait plus que des hash_get pendant les cycles. Mais la fonction hash_get est MT-Safe.

sprintf : pénalisant, c'est sûr. Peut-être un lltostr (ou equivalent) serait plus efficace ?

A+

        Hash-ô-Bob

---------------------------------------------------------

CE COURRIER ELECTRONIQUE EST A USAGE STRICTEMENT INFORMATIF ET NE SAURAIT ENGAGER DE QUELQUE MANIERE QUE CE SOIT EADS ASTRIUM SAS, NI SES FILIALES.

SI UNE ERREUR DE TRANSMISSION OU UNE ADRESSE ERRONEE A MAL DIRIGE CE COURRIER, MERCI D'EN INFORMER L'EXPEDITEUR EN LUI FAISANT UNE REPONSE PAR COURRIER ELECTRONIQUE DES RECEPTION. SI VOUS N'ETES PAS LE DESTINATAIRE DE CE COURRIER, VOUS NE DEVEZ PAS L'UTILISER, LE CONSERVER, EN FAIRE ETAT, LE DISTRIBUER, LE COPIER, L'IMPRIMER OU EN REVELER LE CONTENU A UNE TIERCE PARTIE.



This email is for information only and will not bind EADS Astrium SAS in any contract or obligation, nor its subsidiaries.

If you have received it in error, please notify the sender by return email. If you are not the addressee of this email, you must not use, keep, disseminate, copy, print or otherwise deal with it.

---------------------------------------------------------

reply via email to

[Prev in Thread] Current Thread [Next in Thread]