Re: internal vtable format - name mangling?

Martin Bayer <[email protected]>
Newsgroups gmane.comp.video.gephex.devel
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Georg Seidel wrote:
| 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.

Who is "itself"? Is it the vtable?

| Signature of this function is :
|      void (*)(void**);

void (*)(vtable_ptr); ?

| 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.


typeof(a[0]) = const char* 0-terminated
typeof(a[1]) = void (*)(vtable_ptr)
typeof(a[2]) = // depends on the interface
...
typeof(a[n+2]) = // depends on the interface
typeof(a[n+3]) = unsigned int or void_ptr with 0 as value

- --
GnuPG (ID B3D1B1BB) C2F4 F775 5022 1891 48F4  761D 0A6D E2E7 B3D1 B1BB
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFAQG/aCm3i57PRsbsRArJRAJ99FhTTG3G9junpvr534I1RipL+XgCfedUK
EhmJrs85zQ/G2kCnvTnUdrc=
=Qaqq
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.