That cleared it up, thank you for the quick response.

-/renji


On Mon, Jun 30, 2014 at 12:17 AM, Richard Hipp <d...@sqlite.org> wrote:

> On Sun, Jun 29, 2014 at 11:57 AM, Renji Panicker <renjipanic...@gmail.com>
> wrote:
>
> If some variable "p" is a pointer to the vfstrace object, then the
> underlying sqlite3_file object immediately follows it in memory.  In other
> words, the underlying sqlite3_file is at (sqlite3_file*)p[1].
>



>
>

> >
> > - When I receive a call to my xOpen function, the 3rd parameter is a
> > sqlite3_file* type.
> >
> > - As per the sqlite3PagerOpen function, the size of the memory allocated
> to
> > this pointer is ROUND8(pVfs->szOsFile).
> >
> > - On Windows, the value of szOsFile is sizeof(winFile) + sizeof(myFile).
> >
> > - As per the sample shims, in my xOpen handler, I must typecast the
> > sqlite3_file* value to myFile*
> >
> > Does this mean that winFile and myFile are now overlapping at the same
> > memory location?
> >
> > For example: if sqlite3_file is defined as:
> >
> > struct sqlite3_file {
> >
> > const struct sqlite3_io_methods *pMethods;  /* Methods for an open file
> */
> >
> > };
> > and winFile is defined as:
> >
> > struct winFile {
> >
> >   const sqlite3_io_methods *pMethod; /*** Must be first ***/
> >
> >   sqlite3_vfs *pVfs;      /* The VFS used to open this file */
> >
> > };
> >
> > and myFile is defined as (taken from multiplex sample shim):
> >
> > struct myFile {
> >   sqlite3_file base;              /* Base class - must be first */
> >   multiplexGroup *pGroup;         /* The underlying group of files */
> >
> > };
> >
> > Wouldn't winFile::pVfs and myFile::pGroup be at the same location in
> > memory?
> > _______________________________________________
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
>
>
>
> --
> D. Richard Hipp
> d...@sqlite.org
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to