Re: Symbol table
- From: "T.M. Sommers" <tms@xxxxxx>
- Date: Wed, 08 Nov 2006 13:08:34 -0500
T.M. Sommers wrote:
This seems to me to be a premature optimization. It should only
be tried if you have proven that malloc()ing symbols individually
is a real bottleneck.
Or after looking at the space overhead required for a malloc operation.
Don't forget that most memory managers reserve something like 8 to 16
bytes of metadata to keep track of the allocation. If you allocate
1000s of 20-byte objects via malloc, you could wind up using twice as
Of course, on modern machines, who really cares. Even if you allocate
1,000,000 symbols, that's only 20MB, not much on a 2GB machine :-)
The OP's method will have its overhead, too. Espeically if you ever want to free any symbols, such as when they go out of scope. If you don't free such symbols, that is another kind of overhead.
Thomas M. Sommers -- tms@xxxxxx -- AB2SB
- Prev by Date: Re: Symbol table
- Next by Date: Re: Linux / Windows GUI application with assembly
- Previous by thread: Re: Symbol table
- Next by thread: Re: Symbol table