|
|||||||||||
|
Technical Support Support Resources
Product Information |
C166: Using xhuge Pointers With Library Routines Like strcpyInformation in this article applies to:
SYMPTOMSI have a lot of data structures that are larger than 64K. They are declared with the xhuge memory type. I'm using strcpy to copy data and the copy doesn't seem to work correctly. I'm using the HLARGE memory model. Are there any known problems with doing this? CAUSEThe problem you are having is a result of the assumed data type in the HLARGE memory mode. In HLARGE, variables are huge by default. The strcpy library routine (as well as many others) use standard types, for example:
The pointers you pass to strcpy are assumed to be pointers to huge variables and not pointers to xhuge variables. RESOLUTION 1A number of library routines have xhuge equivalents. For example:
For those functions that do not have xhuge equivalents, you must write your own. The following example shows how to write the strcpy library routine for xhuge variables.
RESOLUTION 2A new memory model called XLarge has been introduced which uses xhuge pointer by default. The appropriate library functions will then be used automatically. This can be used with the C166 version 7.04 and later. MORE INFORMATION
Last Reviewed: Thursday, February 25, 2021 | ||||||||||
|
|||||||||||
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.