git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Petr Baudis <pasky@suse.cz>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: [PATCH] Eliminate Scalar::Util for something simpler
Date: Mon, 3 Jul 2006 23:49:56 +0200	[thread overview]
Message-ID: <20060703214956.GP29115@pasky.or.cz> (raw)
In-Reply-To: <20060703204803.28541.67315.stgit@machine.or.cz>

Dear diary, on Mon, Jul 03, 2006 at 10:48:03PM CEST, I got a letter
where Petr Baudis <pasky@suse.cz> said that...
> +		xs__call_gate(Scalar::Util::refaddr($self), $self->repo_path());

This was silly and requires Scalar::Util.

->8-
Signed-off-by: Petr Baudis <pasky@suse.cz>
---

 perl/Git.pm |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/perl/Git.pm b/perl/Git.pm
index 65acaa7..f2467bd 100644
--- a/perl/Git.pm
+++ b/perl/Git.pm
@@ -92,13 +92,14 @@ increate nonwithstanding).
 use Carp qw(carp croak); # but croak is bad - throw instead
 use Error qw(:try);
 use Cwd qw(abs_path);
-use Scalar::Util;
 
 require XSLoader;
 XSLoader::load('Git', $VERSION);
 
 }
 
+my $instance_id = 0;
+
 
 =head1 CONSTRUCTORS
 
@@ -216,7 +217,7 @@ sub repository {
 		delete $opts{Directory};
 	}
 
-	$self = { opts => \%opts };
+	$self = { opts => \%opts, id => $instance_id++ };
 	bless $self, $class;
 }
 
@@ -855,7 +856,7 @@ sub _call_gate {
 		# For now, when we will need to do it we could temporarily
 		# chdir() there and then chdir() back after the call is done.
 
-		xs__call_gate(Scalar::Util::refaddr($self), $self->repo_path());
+		xs__call_gate($self->{id}, $self->repo_path());
 	}
 
 	# Having to call throw from the C code is a sure path to insanity.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Snow falling on Perl. White noise covering line noise.
Hides all the bugs too. -- J. Putnam

  parent reply	other threads:[~2006-07-03 21:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-03 20:44 [PATCH 0/6] The residual Git.pm patches Petr Baudis
2006-07-03 20:47 ` [PATCH 1/6] Git.pm: Add config() method Petr Baudis
2006-07-03 20:47 ` [PATCH 2/6] Convert git-send-email to use Git.pm Petr Baudis
2006-07-03 20:48 ` [PATCH 3/6] Git.pm: Introduce ident() and ident_person() methods Petr Baudis
2006-07-03 20:48 ` [PATCH 4/6] Make it possible to set up libgit directly (instead of from the environment) Petr Baudis
2006-07-03 21:30   ` Petr Baudis
2006-07-03 21:49   ` Petr Baudis [this message]
2006-07-03 20:48 ` [PATCH 5/6] Git.pm: Introduce fast get_object() method Petr Baudis
2006-07-03 20:48 ` [PATCH 6/6] Convert git-annotate to use Git.pm Petr Baudis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060703214956.GP29115@pasky.or.cz \
    --to=pasky@suse.cz \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).