Re: Curious about inconsistent-seeming types
Re: Curious about inconsistent-seeming types
- Subject: Re: Curious about inconsistent-seeming types
- From: Sherm Pendley <email@hidden>
- Date: Wed, 25 Jun 2003 21:50:19 -0400
On Wednesday, June 25, 2003, at 08:56 PM, Andrew Merenbach wrote:
The NSOutlineViewDataSource protocol contains the following method
declaration:
- (int)outlineView:(NSOutlineView *)outlineView
numberOfChildrenOfItem:(id)item;
Is it conceivable that these differences could (hypothetically) cause a
problem in larger arrays that need to display hierarchical data?
A process is limited - at least with current G3's and G4's - to a 32-bit
address space. To allocate two billion objects, thus hitting the limit
of an unsigned integer index, you'd have to allocate at most two bytes
per object - which is impossible, as the isa pointer alone takes twice
that. And that's a very simplistic example; it assumes the entire
address space is available for your array, which will never be the case.
The G5 has a 64-bit virtual address space, but it also uses 64-bit ints.
So, even though the actual numbers are much, much bigger, the principle
is the same; in order to exceed the range of an unsigned index variable,
you'd have to use impossibly small objects in order to fit them all in
the available address space.
In short, while it could cause a problem in theory, in practice you'd
run out of memory long before it could happen, if you were using
ordinary NSArrays for data storage.
In practical terms, supposing I were building a data warehouse or other
application that needed to display an immense number of objects, and in
order to avoid the above limits, I'd implemented a data source that drew
data from a database rather than from objects allocated in memory.
Even then, I'd be more concerned with the user experience than with
technical limitations. Even a few million objects, well within the
capacity of an ordinary outline view with an NSArray data source, is
more than enough to give your users information overload. I'd be more
concerned with figuring out how to give my users a good set of tools for
filtering out a usable subset and/or summary of the data, than with
figuring out how to display it all at once.
sherm--
Heisenberg may have slept here.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.