|
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,have/haven't
The code that makes the dump doesn't know how much memory you
allocated. That information is only known to YOUR code.in a
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
zillion years notice that 80k. You are wasting time and creatingheadaches
by keeping tracking of allocation sizes (and from your description, therenuts
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
for using dynamic memory for that.--
And this is coming from someone who LIKES working with pointers!
-SK
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.