Changeset 257 for trunk/src/helpers/nlscache.c
- Timestamp:
- Jan 8, 2004, 5:43:29 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/nlscache.c
r243 r257 289 289 * After that, this function implements a fast string 290 290 * cache for various NLS strings. Compared to the 291 * standard method, this has the following advantages: 292 * 293 * -- Memory is only consumed for strings that are actually 294 * used. The NLSSTRINGS array had become terribly big, 295 * and lots of strings were loaded that were never used. 296 * 297 * -- Program startup should be a bit faster because we don't 298 * have to load a thousand strings at startup. 299 * 300 * -- The memory buffer holding the string is probably close 301 * to the rest of the heap data that the caller allocated, 302 * so this might lead to less memory page fragmentation. 303 * 304 * -- To add a new NLS string, before this mechanism existed, 305 * three files had to be changed (and kept in sync): common.h 306 * to add a field to the NLSSTRINGS structure, dlgids.h to 307 * add the string ID, and xfldrXXX.rc to add the resource. 308 * With the new mechanism, there's no need to change common.h 309 * any more, so the danger of forgetting something is a bit 310 * reduced. Anyway, fewer recompiles are needed (maybe), 311 * and sending in patches to the code is a bit easier. 291 * standard method of preloading all NLS strings at 292 * program startup, this method of on-demand string 293 * loading has the following advantages: 294 * 295 * -- Memory is only consumed for strings that are actually 296 * used. 297 * 298 * -- Program startup should be a bit faster because we don't 299 * have to load a thousand strings at startup. 300 * 301 * -- The memory buffer holding the string is probably close 302 * to the rest of the heap data that the caller allocated, 303 * so this might lead to less memory page fragmentation. 304 * (This is a wild guess though.) 305 * 306 * -- To add a new NLS string, before this mechanism existed, 307 * three files had to be changed (and kept in sync): common.h 308 * to add a field to the NLSSTRINGS structure, dlgids.h to 309 * add the string ID, and xfldrXXX.rc to add the resource. 310 * With the new mechanism, there's no need to change common.h 311 * any more, so the danger of forgetting something is a bit 312 * reduced. Anyway, fewer recompiles are needed (maybe), 313 * and sending in patches to the code is a bit easier. 312 314 * 313 315 * On input, specify a string resouce ID that exists
Note:
See TracChangeset
for help on using the changeset viewer.