|
From: Manuel T. <ma...@sp...> - 2000-11-08 10:58:55
|
Hi matju > but: do you do any malloc()/free() to allocate the above bytes? if yes, > then you are using more than that amount, and, depending on the number of > allocations and the allocator used, maybe much more than that. OTOH, if > you are doing your stuff via fixed-size cons cells, then you have a much > slimmer overhead. You are right about the malloc/new overhead, and actually my equation is not entirely accurate because: 1> I forgot 3 more words used by the hashtable (for size, capacity and ptr to an array) and 2> The 4 words per slot are an approximation because the hashtable uses an array of linked nodes. 3 words come from the node and 1 from the array. But the size of the array can be more or less that the number of entries in the table. But the point of this really was just a rough comparison between the current and the new objects implementation's memory footprints. Later I may be able to optimise things further (ex by writing a copying GC). Manuel |