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



I'd change the ported code to use malloc(), and add code to clean up the allocations (as appropriate)

That way, your code would be portable, run anywhere, etc.

If you use a MI call, such as _modasa, that code will only run on IBM i... if you try to port to another system that doesn't have alloca(), you'll need a separate workaround for that system, and you end up with 20+ sections of #define macros for compatibility.

Better to use malloc/free and write it in a portable fashion in the first place. (I'd only write my own alloca() if changing to malloc() would be too time-consuming.)


On 12/3/2010 1:46 PM, Schmidt, Mihael wrote:
Hi,

the ported software uses alloca() at some locations. Obviously alloca() is not support on IBM i. What is the alternative? malloc? What do I have to take into account when changing this to malloc? (besides freeing the memory afterwards)

Thanx in advance

Mihael Schmidt
Anwendungsentwicklung

Dirk Rossmann GmbH
Iserhägener Str.16
30938 Burgwedel
* +49 (05139) 898 - 4353

Handelsregister-Nr. HRB 120546, Amtsgericht Hannover
Ust-Id-Nr. DE 115055186
St.-Nr. 16 / 205 / 65401
Geschäftsführer: Dirk Roßmann, Alice Schardt-Roßmann, Roland Frobel, Klaus Praus




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.