0

Possible Duplicate:
What exactly is an 'aligned pointer' ?

please give me the example of this statement:

A normal pointer type was implicitly cast to an aligned pointer type.


actually it is c language Question

Community
  • 1
  • 1
STRANGER
  • 509
  • 1
  • 4
  • 3
  • 1
    pointers in asp.net? are you sure you have the correct tags? – Jagmag Dec 01 '10 at 11:04
  • 1
    Seeing as he also has "iphone", "jquery" and "objective-c as tags, I'm inclined to think no. – Gonzalo Quero Dec 01 '10 at 11:05
  • this question has already been answered. Please do not repost (http://stackoverflow.com/questions/4322926/what-exactly-is-an-aligned-pointer/4323044#4323044) – Yanick Rochon Dec 01 '10 at 11:08
  • Please show the code that generates the error. – JeremyP Dec 01 '10 at 11:21
  • @Yanick Rochon: That is not the same question. It was merely asking what an aligned pointer is. This is asking what could cause a particular error message. – JeremyP Dec 01 '10 at 11:24
  • @JeremyP, the old question could have been amended with this very question : "And why should I get this message... ?" providing the compiler used also given. In short, this question should be closed IMO and his prior one should be detailed further. – Yanick Rochon Dec 01 '10 at 11:39
  • @ Yanick Rochon: that would be changing the old question though. The already given answers would then look incomplete and might attract down votes. – JeremyP Dec 01 '10 at 11:43

1 Answers1

1

I don't believe you can cast them. Pointers which are aligned are normal. You have to declare something as __packed to get it to be un-aligned.

You should read up on how the ARM processor works. Alignment causes very quick memory access. If you need things packed further, I recommend storing your data as a BLOB in a NSData or using a C-style byte[] array.

Also, see this question/answer. and this one.

Community
  • 1
  • 1
Stephen Furlani
  • 6,794
  • 4
  • 31
  • 60