Hi,

* Thorsten Haude wrote (2008-01-06 01:40):
>/* Allocate a new string buffer of length chars */
>char *AllocString(int length)
>{
>    char *mem;
>    
>    mem = XtMalloc(length + sizeof(char *) + 1);
>    *((char **)mem) = AllocatedStrings;
>    AllocatedStrings = mem;
>#ifdef TRACK_GARBAGE_LEAKS
>    ++numAllocatedStrings;
>#endif
>    return mem + sizeof(char *) + 1;
>}
>
>- Also, it returns (mem + sizeof(char *) + 1), which is (char* +
>  size_t + int). What is this supposed to bring about?

A bunch of function test whether AllocString's return value is True or
False. This happens if  XtMalloc() returns -(sizeof(char *) + 1).


Thorsten                                      Placebo: Sleeping With Ghosts
-- 
It is exactly because markets are amoral that we cannot
leave the allocation of resources entirely to them.
    - George Soros

Attachment: pgpmgEi5Ay8fd.pgp
Description: PGP signature

-- 
NEdit Develop mailing list - [email protected]
http://www.nedit.org/mailman/listinfo/develop

Reply via email to