[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: dynamic array size?



At 08:41 AM 10/22/01 -0500, Ray Ontko wrote:
>Not to put too fine a point on it, I think that when you declare the
>array, SQR creates an array of "pointers", usually 4 bytes per array
>element.  Only when you start to populate rows in the array are
>additional bytes allocated.  I'll guess that for each row, there
>is an overhead of 4 bytes per field or occurrence in the row.
>Further, there is additional overhead per string, decimal, or
>date value.
>
>In answer to David's original question, the overhead per row
>is about 4 bytes even if you only use 400 rows out of a million.

(And Stan Quick wrote a very helpful answer explaining how this is done
using "memalloc" in C...)


Great - this was exactly the CompSci-geeky answer I was looking for...

But my next question is, what is the upper limit of the array size?  Can it
actually be anything, or does it have to be <= the largest integer SQR can
handle (about 2 billion,. which I presume is 2^32...)?

I could test it myself, but if someone already knows, then I won't have
to... *grin*

DTH

David Thompson-Hall                                     1210 W. Dayton St.
Programmer/Analyst                                      Madison, WI 53706
Apps Tech/Business Operations Apps                      608/265-9571
Div of Info Technology (DoIT)
University of Wisconsin-Madison david.thompson-hall@doit.wisc.edu