INFO: More Information About Atoms (12384)
The information in this article applies to:
- Microsoft Windows Software Development Kit (SDK) 3.1
This article was previously published under Q12384
2.x 3.00 3.10
WINDOWS
kbprg
SUMMARY
The following are questions on Atoms that expand on the description of
Atoms:
- Q. Is it reasonable to use Atoms to store strings of data?
A. Yes, you can store constant strings of data using Atoms.
- Q. Why is there no Atom for a null string?
A. There is no Atom for a null string because none is defined.
- Q. How are Atoms stored?
A. Atoms are hashed with bucket chaining used to resolve
collisions. The memory for the Atoms is allocated out of the
caller's DS. The overhead per Atom is 9 bytes (4 for the memory
arena, 5 for the Atom structure).
- Q. What is the penalty for declaring many Atoms and then only using
a few?
A. The only consequences of declaring many Atoms and then only
using a few are the consumption of memory and the increased
chain of collisions.
- Q. Are there reasonable limits to the number of strings that can be
stored as Atoms?
A. The absolute limit to the number of strings that can be stored
as Atoms is the size of the caller's data segment.
- Q. Is there any way to share Atoms between two instances of a
program?
A. To share Atoms between two instances of a program, have a shared
library .EXE file with a single data segment that holds the
Atoms to be shared. The Windows user interface code is an
example of this.
- Q. Is there a limit to the number of characters in a string that is
being stored as an Atom?
A. The limit to the number of characters in a string being stored
as an Atom currently is 255.
- Q. Are Atoms movable?
A. Atoms are constants, and therefore are not movable.
- Q. Do Atoms get swapped?
A. Atoms do not get swapped.
Modification Type: | Minor | Last Reviewed: | 3/7/2005 |
---|
Keywords: | kb16bitonly kbinfo KB12384 |
---|
|