× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



O.k., o.k., o.k. I've seen the light. Scott, thank you for reminding me
of the context of 80k on today's Power i systems. Of course, this was just
an example, but I'm sure most arrays in our production code aren't too far
off that figure.

Thanks everyone!
- Dan

On Wed, Mar 8, 2017 at 3:20 PM, Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx>
wrote:

Dan,

The code that makes the dump doesn't know how much memory you have/haven't
allocated. That information is only known to YOUR code.

So when you say DIM(5000), the dump program tries to list 5000 elements.
Again, it doesn't know that you've only reserved memory for 32 elements!
You said 5000! So when it tries to read the full 5000 elements, it runs
into an error -- and therefore prints that the data wasn't addressable.

What frustrates me is to see someone using dynamic memory at all for
this! It's only an 80k total size array... believe me, you'll never in a
zillion years notice that 80k. You are wasting time and creating headaches
by keeping tracking of allocation sizes (and from your description, there
are bugs in that) and giving yourself headaches keeping track of it for
WHAT, exactly?

Even if this were megabytes, it might be hard to argue that it's
worthwhile to use dynamic allocation. But for 80k?! Frankly, you're nuts
for using dynamic memory for that.

And this is coming from someone who LIKES working with pointers!

-SK


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.