AT> I don't know about you, or anybody else in this echo,
AT> but personally, I try to stay right away from dynamic
AT> memory allocation altogether. If you are
AT> allocating/freeing many small and large blocks of
AT> memory continuously, eventually you may get to the
AT> point where there are NO blocks large enough to
AT> accomodate your request.
When I was doing Win16 development, I tried to stay away from all memory
allocation. ;-) Anything that had to stick around for a long time would
likely be statically allocated on the heap. i.e.:
static struct foo* pf = malloc(sizeof(*pf));
4 bytes of static storage, sizeof(struct foo) heap storage. This was to keep
the stack clean - we only had 4k of stack left to play with - and to keep the
data segment clean - we never determined its size empirically, but it
couldn't have been much larger.
Now I don't worry about it - 32-bit development has a lot more available
room. 512 meg of memory space under OS/2, 2 or 4 gig of memory space under
Win32. Just so long as I free what I no longer need, it'll likely be okay.
---
---------------
* Origin: Tanktalus' Tower BBS (1:250/102)
|