Re: [Libclc-developers] An alternative clc_list approach + an iterator.
Status: Planning
Brought to you by:
augestad
|
From: <bo...@me...> - 2003-03-22 16:06:19
|
Hallvard B Furuseth wrote: > Iterator: > > clc_begin() and clc_end() looks like functions that begin and end > something. Call them clc_atstart() and clc_atend(). > > Except, we may want more firsts and nexts and whatever, so maybe the > iterator functions should start with clc_iter_, not just clc_. > > List: > > I still think the names should either be _new and _delete like in C++ > or _alloc and _free like in C. Not the mix _new and _free. > Or neither: _make and _destroy, or something. > I see your point and have seen it all along. It's just that I have one more adt up my sleeve which I haven't mentioned at all. This may be the time? The adt is a a general purpose pool. It can be used as e.g. a resource pool, where the "resource" is an adt. The pool e.g. can be a pool of preallocated clc_list objects. This concept is IMO a very good idea in some applications, e.g. high performance multithreaded servers where you want to avoid malloc()/free() bottlenecks or if you want to utilize available memory better by allocating larger chucks of memory and then subdivide it into fixed sizes. The naming problem arises *if* we allow for custom allocators in conjunction with our adt's. Straight malloc/free creation can be named alloc/free, using a pool better names could be get/release. I currently have no good solution, and that's why I've dodged the issue. Now you all know my dark secret :-) -- boa |