jacob navia <> writes:
> Within the container library I have ignored (more or less) the problem
> of the allocator and memory allocation.
One approach that you may not have considered is to make the
library's client do all the memory allocation work. This works
out OK for some kinds of containers where allocation corresponds
directly to client operations. For example, it works fine for
binary tree-based containers, where the client can be made to
provide memory for a node each time it wants to do an insertion
operation. The balanced tree library here works that way:
http://git.savannah.gnu.org/cgit/psp...c/libpspp/bt.h
http://git.savannah.gnu.org/cgit/psp...c/libpspp/bt.c
> P.S. the library of GNU (libavl) has an allocator pointer in each
> container.
If I had time to work on libavl, I'd probably switch to
client-allocated memory.
--
char a[]="\n .CJacehknorstu";int putchar(int);int main(void){unsigned long b[]
={0x67dffdff,0x9aa9aa6a,0xa77ffda9,0x7da6aa6a,0xa6 7f6aaa,0xaa9aa9f6,0x11f6},*p
=b,i=24;for(;p+=!*p;*p/=4)switch(0[p]&3)case 0:{return 0;for(p--;i--;i--)case+
2:{i++;if(i)break;else default:continue;if(0)case 1

utchar(a[i&15]);break;}}}