continues with a suggestion that Devel::CheckLib might be
useful in this sort of situation.
Nicholas Clark
On Thu, Mar 12, 2009 at 01:15:46PM +0100, Gregor Goldbach wrote:
Nicholas Clark wrote:
I understand initialization of an XS module may be modified using
BOOT.
However, there seems to be no counterpart of BOOT. How do I e.g. free
memory I allocated in BOOT?
[...]
Or is the current
, well, global, might not
any more)
Nicholas Clark
the SvRV(...) only once, and store the
result locally.
Nicholas Clark
autoloading via h2xs's -A flag, then my #defines are ignored
also because -A implies the -c flag to omit constants.
What am I missing here?
I think you need the --skip-autoloader flag for h2xs
Nicholas Clark
a bitmask, never a simple TRUE/FALSE, but
until recently the documentation wasn't very good.
Nicholas Clark
On Mon, Apr 28, 2008 at 11:50:37PM +0100, Nicholas Clark wrote:
On Mon, Apr 28, 2008 at 03:48:35PM -0700, Jan Dubois wrote:
Use the GV_ADDMULTI flag:
if (sv = get_sv(Win32::SqlServer::Version, TRUE | GV_ADDMULTI))
Really that should be
if (sv = get_sv(Win32
variable for
non-threaded builds, and access to thread-local storage for threaded builds.
Nicholas Clark
might need to manage the sign explicitly.
Nicholas Clark
On Mon, Jan 08, 2007 at 10:39:57AM -0800, Marvin Humphrey wrote:
On Jan 8, 2007, at 10:26 AM, Nicholas Clark wrote:
Am I doing something wrong? Maybe because of refcounts and such?
Yes, I think so. (But I'm not the expert on these)
8 snip 8
RETVAL = sv_2mortal
.
Curious. We thought that we'd nailed (most?) every leak in current blead.
As of about a week ago, Dave got the last known eval leaks.
(Although the fix is fragile, and if it causes more problems than it solves,
he'll back it out)
Nicholas Clark
as a transformation layer akin to PerlIO::encoding,
rather than a lowest layer akin to unix.
Nicholas Clark
Perl_croak(), and
if they do, I need to destroy the object if I don't want to
leak memory. Here's an excerpt of the original code:
Is this the way to do it?
I think you could also use SAVEDESTRUCTOR() and SAVEDESTRUCTOR_X()
Nicholas Clark
of the SV, and the length of the data in the buffer.
Nicholas Clark
for
5.8.8
Nicholas Clark
));
SvIV(SvRV($arg))
} else {
warn(\$arg is not a blessed object\);
XSRETURN_UNDEF;
}
If I make the above change to use SvRV then I can avoid getting a segfault.
Nicholas Clark
stable compared with where? Some FreeBSD stable perls are compiled
with -Duse64bitint, which will mean that sizeof(IV) is twice the size
of sizeof(void *) on x86.
(and yes, INT2PTR)
Nicholas Clark
to run it under
a debugger and get a stack backtrace?
I'm using perl 5.8.7, compiled with MS Visual C++ Toolkit 2003 (the free
version).
This shouldn't make a difference. If you've got access to x86 Linux, and
the code is portable to Linux, have you tried running it under valgrind?
Nicholas
to internally become encoded as UTF-8,
then the scalar will be PVMG, even if the value it now holds is pure 7 bit
ASCII now.
Nicholas Clark
'} = ${\$VAR1-{'3'}};
because the hash assignment does a copy, not a binding.
Nicholas Clark
.
Nicholas Clark
Also, I've just realised that the perlmod.pod shipped in 5.8.7 is erroneous -
CLONESKIP was only added in 5.8.7, not 5.7.2 as it seems to suggest.
Nicholas Clark
.
Nicholas Clark
? What is the proper way to create a UTF-8
string--from UTF-8 source--in perl xs?
You're doing the correct thing to create a Unicode string.
You need to use binmode to flag that the filehandle was expecting UTF-8
output.
Nicholas Clark
. (between 5.8.5 and
5.8.6, IIRC)
Nicholas Clark
of the referent by one.
As things are created with one reference, this means that if you do nothing
but create scalars and then store them in hashes or arrays, you don't need
to do anything further to get the reference counts correct.
Nicholas Clark
to be a standard function
in any standard implemented on Unix, but strcmp()'s return is stated only
to be an integer greater than, equal to, or less than 0, not specifically
-1 or +1
Nicholas Clark
messages.
They're not spam messages. Thanks for getting back to say that you found
your problem - letting people know that you've found the problem stops people
chasing things down unnecessarily.
Nicholas Clark
as an
integer, rather than if it's numerically identical to the NV, because NV maths
takes priority. eg:
$ ~/Reference/5.6.2/bin/perl5.6.2-32 -MDevel::Peek -e '$a = 3.2; $a 1; Dump
$a'
SV = PVNV(0x8010a0) at 0x806e6c
REFCNT = 1
FLAGS = (IOK,NOK,pIOK,pNOK,IsUV)
UV = 3
NV = 3.2
PV = 0
Nicholas
runs on
Win32 (and other stuff, even EPOC, IIRC) which is in util.c, is this the
right point to re-implement the Win32 pipe() in terms of that?
Or is this irrelevant?
Nicholas Clark
_think_ this option disables that buggy scheme in favour
of one more like other systems. Will take a look.
The source code is still recoverable from the partition?
Could someone else take it over and get it finished?
Nicholas Clark
for the same reason.
Nicholas Clark
for XSUBs.
I think we either have to make it part of the public API,
so embed.fnc will take care of the rest, or explicitly use
Perl_pad_findmy().
Surely neither is necessary, as on all perl5.8.x (and earlier), $_ will never
be in the pad.
Nicholas Clark
function, hence your segfault]
Nicholas Clark
PS Your mailer did evil things to your source code - it wrapped some of the
lines, and seems to have changed a lot of spaces (or maybe tabs) into
non-breaking spaces (chr(160))
the gcc-specific
constructs)
Nicholas Clark
that includes a fractional component).
Try Perl_floor() on the value and see if it's identical to the original.
(I think that this will always work.)
This answers your question as phrased. Not all integer values fit into IVs.
Nicholas Clark
, so as Nick
says you must unshare anything when you finish with it. The hash is a value
calculated with PERL_HASH
Chasing the source code in hv.c, no it doesn't look like you can just use 0.
Nicholas Clark
-subscribed PDQ.
Likewise if anyone mails me and I find that I get a challenge response back,
I'm going to ignore it.
Nicholas Clark
is why you the same thing working on unthreaded, and failing
spectacularly on a threaded build.
Nicholas Clark
.
Nicholas Clark
a problem. But, obviously, I could be
wrong, as XS isn't really something I know that much about.
Nicholas Clark
it as a dependency in Makefile.PL
Devel::PPPort is supplied in the core for 5.8.0, but I believe that you
can also get the current version separately from CPAN.
Nicholas Clark
--
INTERCAL better than perl? http://www.perl.org/advocacy/spoofathon/
On Mon, May 20, 2002 at 05:12:24PM -0700, Bill Moseley wrote:
At 10:49 PM 05/20/02 +0100, Nicholas Clark wrote:
He means run 'make perl' in the extension directory, rather than make
It builds a new perl statically linked with the extension.
I'm feeling more clueless.
So, I built perl
43 matches
Mail list logo