|
Mel Rothman Mel Rothman, Inc.
D ptrs s * dim(50) D i s 10i 0 C for i = 1 to %elem(ptrs) C alloc 16000000 ptrs(i) C endfor C eval *inlr = *on
>> But what I'd really like to know - is there any reason for OS/400 to return NULL after calling for example r = (char *) malloc(1000000) ;
The major reason would be that you've exhausted the heap space (or at least there no contiguous space of 1,000,000 bytes available). I'm not certain about C, but RPG allocates form the default heap which has 1 16M limit. Unless you specify that the C code is to use terraspace capability then I suspect it has the same limit. If you are using small amounts of memory I wouldn't bother about it - if you're using 1,000,000 byte requests then probably safer to use the CEE APIs and create your own custom heap.
Jon Paris Partner400 www.Partner400.com
_______________________________________________
As an Amazon Associate we earn from qualifying purchases.
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.