× 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.



Hello,

I have a DS array (myds) (below) that is aligned and also which I will
be assigning storage to dynamically. In RPG IV the %size function
indicates that each entry is 644 bytes long (also indicated on the
compile listing), but if I do an "attr myds" in debug is says the size
is 41984 which when divided by the number of elements (64) gives an
element size of 656 which matches a 16 byte aligned structure.

I am concerned that if I use the %size value when allocating storage
that I am not giving sufficient space to the structure which could
cause issues with corrupted memory. Should I be allocating 656 to
each element of myds or 644?

Thanks for any comments on this question.

-Paul

D myds ds likeds(regex_t)
D dim(64)
D based(pMyds)

D regex_t DS qualified
D align based(prototype_only)
D re_nsub Like(size_t)
D re_comp *
D re_cflags 10I 0
D re_erroff Like(size_t)
D re_len Like(size_t)
D re_ucoll Like(LC_COLVAL_T) dim(2)
D re_lsub *
D lsub_ar Like(size_t) Dim(16)
D esub_ar Like(size_t) Dim(16)
D reserved1 *
D re_esub *
D re_specchar *
D re_phdl *
D comp_spc 1A Dim(112)
D re_map 1A Dim(256)
D re_shift Like(mbstate_t)
D re_dbcs 5I 0

D size_t S 10U 0
D LC_COLVAL_T S 10I 0
D mbstate_t S 5I 0

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.