Unicorn with delicious cookie
Nous utilisons des cookies pour améliorer votre expérience de navigation. En savoir plus
Accepter
to the top
>
>
>
Can I use 32-bit pointers in a 64-bit a…

Can I use 32-bit pointers in a 64-bit application?

05 Avr 2013
Author:

At present, the Microsoft Visual C++ and GCC compilers do not allow you to use 32-bit pointers in 64-bit software created for processors based on x86-64 architecture. You can use 64-bit registers and instruction sets together with 32-bit pointers in 32-bit programs on some other platforms (for instance, PowerPC).

The simplest way to circumvent the impossibility of using 32-bit pointers is to store data in global arrays using 32-bit types to index them. The drawback of this method is the impossibility of dynamic memory allocation for such structures durring runtime.

Another way is to encode 64-bit pointers into 32 bits. This article thoroughly describes the operation principles of the 'sptr' function intended for data alignment and specifics and restrictions of its use. The article contains samples illustrating mechanisms of encoding 64-bit pointers into 32-bit ones.

References

Popular related articles

S'abonner

Comments (0)

close comment form
close form

Remplissez le formulaire ci‑dessous en 2 étapes simples :

Vos coordonnées :

Étape 1
Félicitations ! Voici votre code promo !

Type de licence souhaité :

Étape 2
Team license
Enterprise licence
** En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité
close form
Demandez des tarifs
Nouvelle licence
Renouvellement de licence
--Sélectionnez la devise--
USD
EUR
* En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité

close form
La licence PVS‑Studio gratuit pour les spécialistes Microsoft MVP
close form
Pour obtenir la licence de votre projet open source, s’il vous plait rempliez ce formulaire
* En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité

close form
I want to join the test
* En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité

close form
check circle
Votre message a été envoyé.

Nous vous répondrons à


Si l'e-mail n'apparaît pas dans votre boîte de réception, recherchez-le dans l'un des dossiers suivants:

  • Promotion
  • Notifications
  • Spam