default random object?

Yigal Chripun yigal100 at gmail.com
Sat Feb 14 15:47:02 PST 2009


Derek Parnell wrote:
> On Sat, 14 Feb 2009 19:07:52 +0200, Yigal Chripun wrote:
>
>
>> I see.
>> Having 3 functions: malloc(), expand() and free() is indeed a very good
>> design.
>
> Unless you need to contract the allocated memory ;-) I believe that
> realloc() does expansions and contractions, no?
>

use free() to free the part the is not needed anymore?

T* arr = malloc(sizeof(T) * n);
...
tail = arr[x];
free(tail);




More information about the Digitalmars-d mailing list