Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Global Atoms
Message
De
06/09/2004 18:08:38
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
06/09/2004 18:00:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00939784
Message ID:
00939796
Vues:
14
>What I further found out:
>- The maximum size for the stringtype key/info is 256 bytes, I believe.
>- Each redeclaration (with GlobalAddAtom) of the same atom name increases what might be called a 'stack number'. Each delte (with GlobalDeleteAtom) decreases it. So, the most secure way to get rid of the entry is:
do while GlobalFindAtom( cString ) > 0
>	GlobalDeleteAtom( nAtom )
>enddo
It seems to me that this would be an abuse of the original idea of using atoms - which might cause some problems.

What I briefly read some years ago - assuming I read and understood it correctly - is more or less the following.

Atoms are used for efficient storage of strings. Each time you create an atom, with the corresponding functions, Windows will check whether an identical string already exists. If it does, the same space will be used again. If it doesn't, a new atom will be created.

So, it would seem to me that any function must use GlobalAddAtom() to define the string, and a single invocation of GlobalDeleteAtom() to release it. Then, if another program or process happens to still use it, it will remain in memory, as it should.

Reducing the usage count to zero would be an indication that no process, not the one you are currently in, and no other process, uses the specific string any longer.

Regards,

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform