Gwendal. Yes. You've missed something. My application is working code not a hypothetical feature request. BLOB application object pointer lifetime presently works precisely as I've described and without memory leak. My point (and Dominique's point) was that this proposal as it stands isn't a drop in replacement for that BLOB'ed application object pointer protocol.
Your reply also suggests superficial understanding. For example, regarding the SQLITE_TRANSIENT BLOB disposition you mentioned. That one is generally not useful here unless the particular application object can be completely materialized elsewhere in memory from shallow copy without loss of fidelity or introduction of memory leak. I'm not talking about copying dumb strings. These are highly stateful and possibly third party objects containing still more pointers and reference counters. They cannot be memcopied around willy-nilly. Take a look at my earlier email that really applied the BLOB object technique to functions if you have genuine interest. This isn't some half baked idea that came about in a flight of fancy. There is a thread of emails leading up to this point. On Mon, Jul 24, 2017 at 11:12 AM, Gwendal Roué <gwendal.r...@gmail.com> wrote: > > > Le 24 juil. 2017 à 19:02, petern <peter.nichvolo...@gmail.com> a écrit : > > > > Great. But, if this is an ultimate replacement for BLOB'ed pointers, > these > > new pseudo-null pointers must support SQLITE_STATIC and destructor > function > > pointer lifetime disposition for those migrating their code. > > You're right that the new APIs make pointer values unsuitable for > *intermediate* values. > > For example, `SELECT free(use(initialize(alloc(123))))`, while possible, > is out of scope. One can define such functions, but it's very risky to > misuse them, leak memory, or double-free. > > The new pointer values indeed look *designed* so that the lifetime of > pointed values is managed *outside* of any statement execution. > > I fail to see how blob'ed pointers did not have the exact same issue. > SQLITE_STATIC and SQLITE_TRANSIENT manage the lifetime of the blob content, > not of the content pointed by a blob'ed pointer. Or did I miss something? > > Gwendal Roué > > _______________________________________________ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users