Hacker News new | ask | show | jobs
by eco 4664 days ago
There are a lot of interesting things you can do with a massive address space even if you don't have the RAM to back it. You can mmap massive files. False pointers are virtually nonexistent for conservative GCs in a 64-bit environment (I believe modern Objective-C is compiler supported refcounting though so this doesn't really apply here). You can virtual alloc a 4GB array and just let it grow in physical memory on demand.

There is also a new instruction set to go along with the bump to 64-bits which improves things. However, I remember Herb Sutter saying that, in the case of x64, Microsoft generally found that the improved instruction set performance gains were a wash due to the increased cache misses caused by the doubling of the pointer width. I'm not sure how much ARM 64-bit instruction set improves things.

2 comments

I'm definitely out of my depth here, I guess I just wasn't really convinced 32-bit was ever a ceiling on the iPhone. I'm sure Apple have their reasons though, and maybe massive files and 4GB arrays and really do matter to iPhone users more than I thought. I'm sure Apple have some reason beyond marketing, since I doubt the general consumer really cares.
> (I believe modern Objective-C is compiler supported refcounting though so this doesn't really apply here)

Yeah, I don't think they ever supported GC in iOS. Now that you mention it, it's probably not a coincidence that it was added to the Mac shortly after the entire product line had switched to 64-bit. You could still do it in 32-bit, but I doubt they were expecting many developers to start writing new 32-bit apps at that point.

What does use a conservative garbage collector on iOS, however, is Safari's JS engine. But I assume that the conservative scan is only used on the stack (that's what FF does), since it would be kind of silly to do a conservative scan of the heap for a language that doesn't support pointers. So it doesn't seem likely under normal circumstances that you'd have many false hits even with 32-bits.