At 11:12 PM +0100 2001/07/14, Igor Mozolevsky wrote:
>--On 14 July 2001 14:46 -0700 Jim Schram <[EMAIL PROTECTED]> wrote:
>
>>Well, a little common sense on your part should have caused you to ask
>>yourself how an API which takes a pointer into random memory could
>>possibly deallocate that memory.
>
>Quite simply:-
>
>#define FAILURE 1
>#define SUCCESS 0
>#define NIL 0
>
>UInt8 func1(void) {
>MemPtr foo;
>
>...
>if((foo = MemPtrNew(...)) == NIL)
> return FAILURE;
>
>...
>if(funct2(&foo) == FAILURE)
> return FAILURE;
>}
>
>UInt8 func2(MemPtr *ptr) {
>...
>if(MemPtrFree(*ptr) == NIL)
> return FAILURE;
>}
Note how MemMove specifies void * parameters, while func2 specifies MemPtr parameters.
This tells you that func2 requires pointers to dynamically allocated memory blocks,
while MemMove does not. Thus MemMove cannot possibly safely deallocate memory passed
to it, while func2 may (and in the above implementation, does).
>Finally, addressing those who are concerned and not pointing a finger at anyone in
>particular, what is this idiotic hostility towards eachother??? Isn't the aim of
>these forums to help and support each other??? If you just wanna troll, go and join
>yahoo chat or wonder around EFNet... Most of you have a lot to learn, especially from
>people that offer their time and help on irc.openprojects.net!
It's a single-to-noise ratio issue; the quality of questions has decreased while the
bandwidth required to conclude them has increased. Not surprisingly, this annoys most
people, because it degrades the value of the forum. Especially when 90% of the answers
can easily be found in 1.) the programming documentation (API reference and companion
docs), 2.) the Palm Knowledgebase, and/or 3.) the sample code.
Regards,
Jim Schram
Palm Incorporated
Partner Engineering
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/