Le 01/05/12 01:50, Joe keane a écrit :
> In article<jnl98c$6hk$>,
> jacob navia<> wrote:
>> typedef struct tagPQueueInterface {
>> // Constructors
>> PQueue *(*Create)(size_t elementSize);
>> PQueue *(*CreateWithAllocator)(size_t elementSize,
>> ContainerMemoryManager *allocator);
> [...]
>> // Destroys the queue
>> int (*Finalize)(PQueue *Q);
>> } PQueueInterface;
>
> Some recent code:
>
> --xxalloc.h
> extern int xx_heap_create(int (*ualloc)(void *rock, size_t size, void **ret),
> int (*ufree)(void *rock, size_t size, void *mem),
> void *urock, size_t size, struct xx_heap **ret);
> extern int xx_heap_delete(struct xx_heap *heap);
>
> --xxdefault.h
> #define xx_heap_create_default(SIZE, RET) \
> xx_heap_create(xx_default_ualloc, xx_default_ufree, NULL, SIZE, RET)
>
> extern int xx_default_ualloc(void *rock, size_t size, void **ret);
> extern int xx_default_ufree(void *rock, size_t size, void *mem);
>
> The latter two are simply patch cords for 'malloc' and 'free'.
I did not understand your answer. Can you explain?
I am proposing a priority queue for the containers library I am writing
in C. In that context I wanted to discuss its interface.
I do not see the relationship of your code with my message.
You can see the rest of the library and the documentation in
http://code.google.com/p/ccl/
jacob