New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GDBM_File support on Win32 #10033
Comments
From @kmxCreated by @kmxHi, I want to follow up the discussion started by csjewell couple of weeks We (=strawberry perl project) want to add GDBM_File support to However we need the following changes in GDBM_File: Inline Patchdiff --git a/ext/GDBM_File/GDBM_File.xs b/ext/GDBM_File/GDBM_File.xs
index 5f88223..890d4e0 100644
--- a/ext/GDBM_File/GDBM_File.xs
+++ b/ext/GDBM_File/GDBM_File.xs
@@ -40,6 +40,10 @@ static void
output_datum(pTHX_ SV *arg, char *str, int size)
{
sv_setpvn(arg, str, size);
+ /* workaround for USE_IMP_SYS scenario
+ * at this point the original system free()
+ * is redefined by perl macro */
+ #undef free
free(str);
}
-- kmx Perl Info
|
From @kmxHello, I would like to kindly ask somebody competent and knowledgeable to take output_datum(pTHX_ SV *arg, char *str, int size) Without this patch there is no chance to have GDBM_File on Win32. Just to remind you - some opinions (Steve Hay, Vincent Pit, Nicholas Thanks in advance. -- |
@kmx - Status changed from 'new' to 'open' |
From @TuxOn Thu, 07 Jan 2010 00:36:25 -0800, "kmx via RT"
*IF* someone knowledgeable enough decides, please change that then to +# undef free (put the hash on position 0), as there are recent compilers that will
-- |
From @kmxDne pá 08.led.2010 04:35:46, hmbrand napsal(a):
I just want to remind this IMHO not so complicated issue. To support the proposed patch: 1) The same "#undef free" trick is also used in 2) I think that GDBM_File module currently does not work properly for 3) There is real demand for this module among strawberry perl users Thanks for any help. -- |
From @obra
Are tests actually failing on a vanilla Win32 build of blead?
As a downstream distributor, there's absolutely no reason why Strawberry |
From @steve-m-haykmx via RT wrote on 2010-01-12:
Sorry for the slow response on this...
It's the same code (to do with $ENV{TZ}) in both Time-Piece and POSIX, so that only counts as one other place. It's also a little different in that it #undefs both malloc and free specifically to ensure that the system malloc is used (and therefore the system free must be used to match). In this case you're only proposing to #undef free, which I think is wrong. The malloc function being used (in gdbm_TIEHASH()) is safemalloc(), so I think the free() in output_datum() just needs to be changed to a safefree() to match it (as per the safefree() in gdbm_DESTROY()). The safemalloc/safefree pair will be different things in different builds (PERL_MALLOC and/or PERL_IMPLICIT_SYS or not), but should always be a matching pair. I don't have libgdbm around so that's all untested, but that's my (possibly faulty) understanding of things.
Please could you try changing the free() to a safefree() and see if that fixes your failures? If it does then I'd be happy to apply that change. I'm not so confident of your proposed patch because I think it could just be swapping one failure (with PERL_IMPLICIT_SYS) for another (in some other build configuration).
Thanks for your persistence. |
From @kmx
Our Win32 binaries of libgdm is available here:
Changing free() to safefree() in the function output_datum does not t/gdbm.t .. Free to wrong pool 3f5aa8 not f0191 at t/gdbm.t line 90. I am suspicious that libgdbm calls system malloc() somewhere inside the -- |
From @craigberryOn Tue, Jan 12, 2010 at 10:38 AM, Steve Hay <SteveHay@planit.com> wrote:
I don't find it particularly easy to understand either, but I think |
From @craigberryOn Wed, Jan 13, 2010 at 10:55 PM, Craig A. Berry
And furthermore, getting back to the system's free was clearly the http://perl5.git.perl.org/perl.git/commitdiff/77b7876f031d35ba2fd89257c6bcaa395e15bbb9 |
From @kmxDne čt 14.led.2010 06:42:13, craig.a.berry@gmail.com napsal(a):
http://perl5.git.perl.org/perl.git/commitdiff/77b7876f031d35ba2fd89257c6bcaa395e15bbb9 So does anybody know about a better way of calling the original system If not I would appreciate applying "#undef free" patch to Thanks. -- |
From zefram@fysh.orgkmx via RT wrote:
The other way to avoid macro interpretation is to parenthesise, so -zefram |
From ben@morrow.me.ukQuoth zefram@fysh.org (Zefram):
It appears to me that safesysfree is there for when you need to Ben |
From @craigberryOn Fri, Jan 15, 2010 at 2:06 PM, Ben Morrow <ben@morrow.me.uk> wrote:
So you'd think, given the name, and as long as PERL_TRACK_MEMPOOL is The #undef is probably the best way to go. The only way I can see At a different point in the release cycle, I'd see no problem with |
From @doughera88On Fri, 15 Jan 2010, Craig A. Berry wrote:
Perl itself used to (optionally) play that game, though it doesn't now.
If the #undef could be made conditional on some tightly-restricted #ifdef -- |
From @csjewellOn Sun, 17 Jan 2010 14:01 -0500, "Andy Dougherty"
I'm not very much of a C hacker, as far as the Perl source is concerned, (Some way of telling FindExt.pm that Win32 can optionally build --Curtis "Your random numbers are not that random" -- perl-5.10.1.tar.gz/util.c Strawberry Perl for Windows betas: http://strawberryperl.com/beta/ |
From @steve-m-hay2010/1/18 Curtis Jewell <lists.perl.perl5-porters@csjewell.fastmail.us>
In the light of comments and detective work from Craig, I now think Therefore, I'd probably apply the patch as-is, but for the fact that So unless Jesse wants to make an exception for this patch then it'll |
From @csjewellOn Mon, 18 Jan 2010 01:16 +0000, "Steve Hay"
I'm willing to request an exception, as the patch was submitted --Curtis "Your random numbers are not that random" -- perl-5.10.1.tar.gz/util.c Strawberry Perl for Windows betas: http://strawberryperl.com/beta/ |
From @obraOn Sun 17.Jan'10 at 20:45:43 -0700, Curtis Jewell wrote:
"Submitted pre-freeze" isn't actually much of an argument to me, as we
|
From @steve-m-hayJesse Vincent wrote on 2010-01-18:
It's in as e46b65a. Thanks to all |
From @steve-m-hayPatch now committed to blead. |
@steve-m-hay - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#71676 (status was 'resolved')
Searchable as RT71676$
The text was updated successfully, but these errors were encountered: