On 04/09/11 19:44, Adriano dos Santos Fernandes wrote: > On 09-04-2011 08:58, Vlad Khorsun wrote: >>> On 08-04-2011 13:43, alexpeshk...@users.sourceforge.net wrote: >>>> Revision: 52693 >>>> http://firebird.svn.sourceforge.net/firebird/?rev=52693&view=rev >>>> Author: alexpeshkoff >>>> Date: 2011-04-08 16:43:05 +0000 (Fri, 08 Apr 2011) >>>> >>>> Log Message: >>>> ----------- >>>> Use interface IBlrMessage instead passing C++ class pointer to API >>>> interface's functions >>>> >>> I'm *very* against this *undiscussed* change. >> You also against endless discucssions of every tiny code change, isn't >> is ? :) >> >>> Pointer to plain struct is know to be portable and usable by the clients >>> we expect to use our API.
I'm far not sure everything is so fine with that structure/class. Look here: unsigned blrLength; const unsigned char* blr; Pointer (8-bytes object) is placed after integer (4-bytes object). C language has a requirement to align it on 8-bytes boundary, but what about others? I't quite possible that some other language will try to save memory. The result is obvious - segfault when we use such structure. >> Plain struct ? It was declared as "class", not as "struct", sorry. If >> you want understanding >> from other developers, please, make you ideas clear. Else there will be such >> "incidents". >> Something obvious for you is not obvious for me and far not obvious for end >> users. This is life. >> >> Btw, i see no problem curently. Alex made change but it is not means it >> can't be undone if >> necessary. >> > Ah, that's it. Every change I do, specially from you come this discurse > of where the thing was discussed. > > But for others, no. It's just a commit that can be undone. > > BTW what about if I just came to whole plugin thing and just removed the > reference counters because it was obviously wrong? Is it just a piece of > code that was write to be undone? (at least it appears to be till now, > cause the implementation is currently broken) > > And "MessageBuffer" was discussed here in this list and you had all your > time to comment on it. > Adriano, from your explanations I did not understand that you plan to pass pointer to it into interfaces. I understood it as a tool to prepare a message (with what I see no problems), but passing pointers to structures into interfaces is definitely wrong solution. But I agree that 4 additional virtual calls is really unneeded (though not dramatic) loss of performance here. To save both performance and avoid tragic misalignment, I suggest to simply return to old format of passing parameters as 4 independent values. This does not prevent use of class Message (aah, name is really not ideal...) to prepare messages, keeps interfaces in clear state and avoids possible performance issues. ------------------------------------------------------------------------------ Xperia(TM) PLAY It's a major breakthrough. An authentic gaming smartphone on the nation's most reliable network. And it wants your games. http://p.sf.net/sfu/verizon-sfdev Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel