> On Dec 5, 2016, at 4:12 PM, Daryle Walker <dary...@mac.com> wrote:
> 
> For the Swift 3 "Data" type, if I want to represent a multi-gigabyte file, it 
> won't try to do it all in memory, would it?  

The Data type specifically represents in-memory data, so yeah, it would. (Where 
by “memory” I mean “address space”, which is not at all the same thing as 
physical RAM on macOS, though it is on iOS. You haven’t specified which 
platform you’re interested in.)

> Or would I have to manage a memory-mapped NSData and somehow connect it to a 
> Data object?

On Mac this would be of limited use; all it changes is that when your data gets 
paged out it will be written to your custom file instead of the OS’s usual swap 
file. It probably won’t improve performance although it would help keep the 
swap file from growing as much.

On iOS, however, this is the way to go if you need large amounts of address 
space. Although I’ve heard that for some reason iOS artificially limits the 
amount of space you can memory-map. I don’t remember what the limit is, but 
it’s on the order of 400MB or so; anyone know for sure? (I think there are old 
threads here about it.)

—Jens
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to