Re: internal vtable format - name mangling?
Georg Seidel <[email protected]>
| Newsgroups | gmane.comp.video.gephex.devel |
|---|---|
| Message-ID | <[email protected]> |
Update of the format: to avoid memory leaks, the vtable will also store
a pointer
to a function that can be used to free itself.
Signature of this function is :
void (*)(void**);
I did not check in the changes, because they are not fully tested yet.
So the updated description is:
This is the format that is used to pass interfaces between plugins and
the core.
The vtable for an interface A is an array of void pointers that is
terminated by a 0 pointer.
The size of the array is 3 + num_funs(A), where num_funs(A) is the
number of functions in
A (this includes constructors, the destructor, methods and static
functions).
The first pointer of the array is a pointer to a 0 terminated string
with the interface name.
The second pointer is a pointer to a free_vtable function that can be
used to free
the memory the vtable uses.
It follows a list of pairs (fun_name, fun_ptr), terminated by a 0 ptr.