More Freetype/FTGL trouble

Moderator
Posts: 3,571
Joined: 2003.06
Post: #31
When I was migrating my code to Intel, a couple of the things besides integer divide by zero which bit me were: foo(i++, i++); does not work on Intel, but did actually work on the PPC. I learned that I should not have ever done that anyway. Another thing to watch out for are uninitialized pointers. I am almost always good about initializing to NULL or something meaningful, but while switching to Intel I found a rare few that weren't. I forgot that the PPC automatically initializes variables to zero first, which saved me from the previous mistakes. The Intel is not so forgiving. Texture endian issues turned out to be very simple to fix, and never caused any crashes anyway.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #32
AnotherJake Wrote:I forgot that the PPC automatically initializes variables to zero first, which saved me from the previous mistakes. The Intel is not so forgiving.

It doesn't...

I think that Mac OS X returns zeroed memory from malloc() more often on PowerPC than Intel, but that's nothing to do with the hardware.

It was only a fluke your code worked at all Rasp
Quote this message in a reply
Moderator
Posts: 3,571
Joined: 2003.06
Post: #33
OneSadCookie Wrote:It doesn't...

I think that Mac OS X returns zeroed memory from malloc() more often on PowerPC than Intel, but that's nothing to do with the hardware.

It was only a fluke your code worked at all Rasp
I meant that whatever allocated the stack frame on the PPC zeroed out the local storage area, which did not happen on the Intel. Admittedly, I don't know how that all works, but it was in a recursive function, so it had to happen a lot.

And yes, I consider it a fluke too, since, as I noted, I always initialize because you are always to assume garbage in an uninitialized variable. But the fact remains that the code worked solidly with uninitialized pointers across different machines for months without issue. *Something* consistently made those pointers zero on the PPC architecture, and not on the Intel architecture. Fluke or not, that's what happened, and I'm reporting to say that it did. Take it as you will.
Quote this message in a reply
Sage
Posts: 1,199
Joined: 2004.10
Post: #34
The real answer here is that I need to get off my duff and buy an intel mac. I've been waiting, since I'm a 100% laptop guy and the MBP has had so many issues. You know, 1st gen apple products and all.

Unfortunately, I can't find any possible div by zero issues in the method that crashed. And as far as I can tell, I don't have any uninitialized pointers -- I'm very serious about explicitly initializing pointers to NULL since ( unlike ObjC ) C++ doesn't zero out classes on allocation.

My plan is to buy an MBP when the apparent 2nd gen arrives, maybe when they get Core 2 Duo or something. I've got the money put away, I'm just being patient.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  How do I flip upside down fonts in FTGL mr5z 4 915 Mar 3, 2014 03:36 PM
Last Post: JustinFic
  Xcode and FTGL hiddenspring81 7 5,875 Oct 10, 2013 03:00 PM
Last Post: ardowz
  Anyone run into this problem with FTGL? wadesworld 1 3,023 Apr 21, 2009 02:19 PM
Last Post: Oddity007
  FTGL crash when exiting program Malarkey 8 5,246 Mar 27, 2008 03:33 PM
Last Post: Malarkey
  Freetype Demo kodex 0 2,385 Mar 6, 2006 10:27 PM
Last Post: kodex