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




Hi David,

I agree with Scott on this one.

For example, the DS may simply be a template designed to NEVER have memory allocated to it and you may be expected to create your own DS likeDS the original DS. Allocating memory to the original DS and using it could be disasterous, or at the very least useless.

Alternatively, the pointer may need to be passed to an API. In this case allocating memory to the basing pointer would be required. But how much memory should you allocate? The amount of memory to allocate may be determined by other API calls and can not be deduced a priori, or it may be obvious from the API docs and constant.

A further option is that there is a second pointer which is allocated the total memory required and the basing pointer you have your DS based on is simply used to overlay the DS over the original pointer data at specified offsets. The data could be allocated sirectly using the %alloc BIF or could be inside a User Space - as in many list API results.

The point is, the solution is in your application code and can not be provided by glib answers from us based on one or two lines of sample code. You need to know what it is you are trying to do with this based DS in order have a complete picture of the process involved. Once you have this knowledge, however, you will probably not need any of us to help you. You will now know whether you should be allocating memory to the pointer or creating a copy DS and using that instead.

Catch 22.

Not helpful, but the best I can offer, other than generalisations and lists of possible solutions. If you are using pointers, it is not the time to experiment with possibilities - you need to know exactly what you are doing.

Cheers

Larry Ducie



_________________________________________________________________
Need a new model in your life? Sell your car fast.
http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fsecure%2Dau%2Eimrworldwide%2Ecom%2Fcgi%2Dbin%2Fa%2Fci%5F450304%2Fet%5F2%2Fcg%5F801459%2Fpi%5F1004813%2Fai%5F866383&_t=758314219&_r=carpoint_tagline&_m=EXT

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.