SlideShare uma empresa Scribd logo
1 de 53
2011.12.10 hiratara
d.hatena.ne.jp/hiratara

twitter.com/hiratara



Perl

YAPC   gihyo.jp
my ($ref1, $ref2, $ref3);
        $ref1 = $ref2;
        $ref2 = $ref3;
        $ref3 = $ref1;



$ref1            $ref2              $ref3
GC

Perl   GC
mark-and-sweep GC
mark-and-sweep GC
mark-and-sweep GC
mark-and-sweep GC
reference counting
     1

              1



1
          1       2


                         1

          2       1
reference counting
     1

              0



1
          1       2


                         1

          2       1
reference counting
     1

              0



1
          0       1


                         1

          2       1
reference counting
     1

              0



1
          0       1


                         1

          1       1
reference counting
     1

              0



1
          0       1   Leak

                         1

          1       1
(1)

    Template::Plugin::Filter
    (TT-2.2)

    Template::Plugin


return $self->{ _STATIC_FILTER } ||= sub {
      $self->filter(shift);
};
(2)
    AnyEvent

my $t; $t = AE::timer 1, 0, sub {
   ...;
   undef $t;
};


            $t           sub { ... }
(2)
    AnyEvent

my $t; $t = AE::timer 1, 0, sub {
   ...;
   undef $t;
};


            $t           sub { ... }
(2)
    AnyEvent

my $t; $t = AE::timer 1, 0, sub {
   ...;
   undef $t;
};


            $t
(2)
    AnyEvent

my $t; $t = AE::timer 1, 0, sub {
   ...;
   undef $t;
};


            $t
(2)
    AnyEvent

my $t; $t = AE::timer 1, 0, sub {
   ...;
   undef $t;
};
(3)


my ($f, $x);
(sub { $f = sub { $x } })->();


                    OUTSIDE



     sub {...}            $f == sub { ... }
(3)
use Devel::Peek; Dump($f);

SV = IV(0x100827fd8) at 0x100827fe0
 REFCNT = 2
 RV = 0x100827878
 SV = PVCV(0x10082b5f8) at 0x100827878
   REFCNT = 1
   GVGV::GV = 0x100856bc0      "main" :: "__ANON__"
   OUTSIDE = 0x1008032a0 (ANON)
   SV = PVCV(0x100852a90) at 0x1008032a0
    REFCNT = 1
    GVGV::GV = 0x100856bc0     "main" :: "__ANON__"
    PADNAME = 0x1008277e8(0x100287000) PAD = 0x100827800(0x10025c0e0)
       1. 0x100827fe0<2> FAKE "$f" flags=0x0 index=1
5
(   ≒       )
1) ps
% perl
 for (1 .. 10000) {
    my $ref; $ref = $ref;

        warn `ps -o rss= -p $$` if $_ % 1000 == 0;
      }
      1272
      1304
      1328
      1352
      1376
...
2) Test::LeakTrace
use Test::LeakTrace;
no_leaks_ok { my $ref; $ref = $ref };
2) Test::LeakTrace
use Test::LeakTrace;
no_leaks_ok { my $ref; $ref = $ref };

               not ok 1 - leaks 1 <= 0
               # Failed test 'leaks 1 <= 0'
               # at - line 4.
               #     '1'
               #           <=
               #     '0'
               # leaked REF(0x10083b610) from - line 4.
               # SV = IV(0x10083b608) at 0x10083b610
               # REFCNT = 1
               # FLAGS = (PADMY,ROK)
               # RV = 0x10083b610
               #     SV = IV(0x10083b608) at 0x10083b610
               #         REFCNT = 1
               #         FLAGS = (PADMY,ROK)
               #         RV = 0x10083b610
               #           SV = IV(0x10083b608) at 0x10083b610
               #             REFCNT = 1
               #             FLAGS = (PADMY,ROK)
               #             RV = 0x10083b610
               #               SV = IV(0x10083b608) at 0x10083b610
               ...
3) Devel::Cycle
use Devel::Cycle;

my ($ref1, $ref2, $ref3);
$ref1 = $ref2;
$ref2 = sub { $ref3 };
$ref3 = [$ref1];

find_cycle($ref1);
Cycle (1):
                          $$A => &B
              $B variable $ref3 => $C
                          $$C => @D
                      $D->[0] => $A
4) Devel::Leak::Object
use Devel::Leak::Object qw{GLOBAL_bless};
$Devel::Leak::Object::TRACKSOURCELINES = 1;

my $ref; $ref = bless $ref => "XXX";

Tracked objects by class:
      XXX                               1

Sources of leaks:
XXX
    1 from - line: 3
5) DESTROY
sub Ref1::DESTROY { warn "destroyed REF1" }
sub Ref2::DESTROY { warn "destroyed REF2" }

my $x;
my $f = bless sub {
    $x;
    bless sub { $x } => "Ref2";
} => "Ref1";
$f->();

destroyed REF2 at - line 2.
destroyed REF1 at - line 1.
Devel::Gladiator



PASS (181) FAIL (436)
5
$self   sub { ... }
my $self = {name => "Hokkaido.pm", handler => undef};
$self->{handler} = sub {
   print "Hello, ", $self->{name}, ".n";
};

$self->{handler}->();




                                sub { ... }

       $self                   “Hokkaido.pm”
1)
my $self = {name => "Hokkaido.pm", handler => undef};
$self->{handler} = sub {
   print "Hello, ", $self->{name}, ".n";
   undef $self;
};

$self->{handler}->();



                                sub { ... }

       $self                   “Hokkaido.pm”
1)
my $self = {name => "Hokkaido.pm", handler => undef};
$self->{handler} = sub {
   print "Hello, ", $self->{name}, ".n";
   undef $self;
};

$self->{handler}->();



                                sub { ... }

       $self                   “Hokkaido.pm”
1)
my $self = {name => "Hokkaido.pm", handler => undef};
$self->{handler} = sub {
   print "Hello, ", $self->{name}, ".n";
   undef $self;
};

$self->{handler}->();



                                sub { ... }


                               “Hokkaido.pm”
1)
my $self = {name => "Hokkaido.pm", handler => undef};
$self->{handler} = sub {
   print "Hello, ", $self->{name}, ".n";
   undef $self;
};

$self->{handler}->();



                                sub { ... }


                               “Hokkaido.pm”
1)
my $self = {name => "Hokkaido.pm", handler => undef};
$self->{handler} = sub {
   print "Hello, ", $self->{name}, ".n";
   undef $self;
};

$self->{handler}->();
1)


(                   )



($self->{handler}       )
2) Scalar::Util::weaken
my $self = {name => "Hokkaido.pm", handler => undef};
Scalar::Util::weaken(my $weaken_self = $self);
$self->{handler} = sub {
   print "Hello, ", $weaken_self->{name}, ".n";
};

$self->{handler}->();


                                sub { ... }

       $self                   “Hokkaido.pm”
2) Scalar::Util::weaken



my $self = {name => "Hokkaido.pm", handler => undef};
Scalar::Util::weaken($self); #
$self->{handler} = sub {
   print "Hello, ", $self->{name}, ".n";
};

$self->{handler}->();
3)
my $self = {name => "Hokkaido.pm", handler => undef};
my $name = $self->{name};
$self->{handler} = sub {
   print "Hello, ", $name, ".n";
};

$self->{handler}->();


                                sub { ... }

       $self                   “Hokkaido.pm”
4)
my $self = {name => "Hokkaido.pm", handler => undef};
$self->{handler} = sub {
   my $self = shift;
   print "Hello, ", $self->{name}, ".n";
};

$self->{handler}->($self);



                                sub { ... }

       $self                   “Hokkaido.pm”
4)

AnyEvent::Handler




   $hdl->push_read (line => sub {
       my ($hdl, $line) = @_;
       ...
   });
5) Data::Decycle

use Data::Decycle;
my $guard = Data::Decycle->new(
    my $self = {name => "Hokkaido.pm", handler => undef}
);
$self->{handler} = sub {
    "Hello, ", $self->{name}, ".n";
};

$self->{handler}->();
5) Data::Decycle

dankogai

            guard

           1)
:Perl 5.8.8


use Devel::Leak::Object qw{GLOBAL_bless};
bless my $x = {}, "Dummy";
(sub { sub { $x } })->();


Tracked objects by class:
      Dummy                                 1
:Perl 5.8.8


my $x = bless {}, "Dummy";
(sub { $x; sub { $x } })->();

my $x = bless {}, "Dummy";
(sub { my $x = $x; sub { warn $x } })->();
:Obj-C              ARC

retain   release                Perl



CBRFuture *future = [[CBRFuture alloc] init];
__weak CBRFuture *weakenFuture = future;
leftHandle(self, ^(id e) {
    current = nil;
    leftSend(weakenFuture, e);
});
:Obj-C             Guard
NSString *local = @"OK";

static void changeLocalValue(BOOL willBreak) {
    id original = local;
    CBRGuard *guard = [[CBRGuard alloc] initGuard:^{
        local = original;
    }];

    local = @"LOCALVALUE1";
}
:Obj-C     Guard



   autorelease

Mais conteúdo relacionado

Mais procurados

Electrify your code with PHP Generators
Electrify your code with PHP GeneratorsElectrify your code with PHP Generators
Electrify your code with PHP GeneratorsMark Baker
 
Object Calisthenics Applied to PHP
Object Calisthenics Applied to PHPObject Calisthenics Applied to PHP
Object Calisthenics Applied to PHPGuilherme Blanco
 
Crafting Custom Interfaces with Sub::Exporter
Crafting Custom Interfaces with Sub::ExporterCrafting Custom Interfaces with Sub::Exporter
Crafting Custom Interfaces with Sub::ExporterRicardo Signes
 
R57shell
R57shellR57shell
R57shellady36
 
Parsing JSON with a single regex
Parsing JSON with a single regexParsing JSON with a single regex
Parsing JSON with a single regexbrian d foy
 
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonf
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonf“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonf
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonfRafael Dohms
 
PHP for Adults: Clean Code and Object Calisthenics
PHP for Adults: Clean Code and Object CalisthenicsPHP for Adults: Clean Code and Object Calisthenics
PHP for Adults: Clean Code and Object CalisthenicsGuilherme Blanco
 
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011Masahiro Nagano
 
You code sucks, let's fix it
You code sucks, let's fix itYou code sucks, let's fix it
You code sucks, let's fix itRafael Dohms
 
Object Calisthenics Adapted for PHP
Object Calisthenics Adapted for PHPObject Calisthenics Adapted for PHP
Object Calisthenics Adapted for PHPChad Gray
 
Symfony components in the wild, PHPNW12
Symfony components in the wild, PHPNW12Symfony components in the wild, PHPNW12
Symfony components in the wild, PHPNW12Jakub Zalas
 
Symfony War Stories
Symfony War StoriesSymfony War Stories
Symfony War StoriesJakub Zalas
 
An Elephant of a Different Colour: Hack
An Elephant of a Different Colour: HackAn Elephant of a Different Colour: Hack
An Elephant of a Different Colour: HackVic Metcalfe
 
Gta v savegame
Gta v savegameGta v savegame
Gta v savegamehozayfa999
 

Mais procurados (20)

Electrify your code with PHP Generators
Electrify your code with PHP GeneratorsElectrify your code with PHP Generators
Electrify your code with PHP Generators
 
Object Calisthenics Applied to PHP
Object Calisthenics Applied to PHPObject Calisthenics Applied to PHP
Object Calisthenics Applied to PHP
 
Crafting Custom Interfaces with Sub::Exporter
Crafting Custom Interfaces with Sub::ExporterCrafting Custom Interfaces with Sub::Exporter
Crafting Custom Interfaces with Sub::Exporter
 
R57shell
R57shellR57shell
R57shell
 
Parsing JSON with a single regex
Parsing JSON with a single regexParsing JSON with a single regex
Parsing JSON with a single regex
 
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonf
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonf“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonf
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonf
 
PHP 5.4
PHP 5.4PHP 5.4
PHP 5.4
 
PHP for Adults: Clean Code and Object Calisthenics
PHP for Adults: Clean Code and Object CalisthenicsPHP for Adults: Clean Code and Object Calisthenics
PHP for Adults: Clean Code and Object Calisthenics
 
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
 
You code sucks, let's fix it
You code sucks, let's fix itYou code sucks, let's fix it
You code sucks, let's fix it
 
Bag of tricks
Bag of tricksBag of tricks
Bag of tricks
 
Object Calisthenics Adapted for PHP
Object Calisthenics Adapted for PHPObject Calisthenics Adapted for PHP
Object Calisthenics Adapted for PHP
 
Symfony components in the wild, PHPNW12
Symfony components in the wild, PHPNW12Symfony components in the wild, PHPNW12
Symfony components in the wild, PHPNW12
 
Rust ⇋ JavaScript
Rust ⇋ JavaScriptRust ⇋ JavaScript
Rust ⇋ JavaScript
 
PHP and MySQL
PHP and MySQLPHP and MySQL
PHP and MySQL
 
Symfony War Stories
Symfony War StoriesSymfony War Stories
Symfony War Stories
 
Shell.php
Shell.phpShell.php
Shell.php
 
An Elephant of a Different Colour: Hack
An Elephant of a Different Colour: HackAn Elephant of a Different Colour: Hack
An Elephant of a Different Colour: Hack
 
Gta v savegame
Gta v savegameGta v savegame
Gta v savegame
 
Barcelona.pm Curs1211 sess01
Barcelona.pm Curs1211 sess01Barcelona.pm Curs1211 sess01
Barcelona.pm Curs1211 sess01
 

Destaque

Stateモナドの解説 前編
Stateモナドの解説 前編Stateモナドの解説 前編
Stateモナドの解説 前編Masahiro Honma
 
モナモナ言うモナド入門
モナモナ言うモナド入門モナモナ言うモナド入門
モナモナ言うモナド入門Masahiro Honma
 
すごいMonad入門
すごいMonad入門すごいMonad入門
すごいMonad入門真一 北原
 
関数型プログラミングとモナド
関数型プログラミングとモナド関数型プログラミングとモナド
関数型プログラミングとモナドMasayuki Isobe
 
Sano tokyowebmining 201625_v04
Sano tokyowebmining 201625_v04Sano tokyowebmining 201625_v04
Sano tokyowebmining 201625_v04Masakazu Sano
 
Building GUI App with Electron and Lisp
Building GUI App with Electron and LispBuilding GUI App with Electron and Lisp
Building GUI App with Electron and Lispfukamachi
 
学生時代に知っておきたかったWeb技術の学び方の学び方 | リブセンス
学生時代に知っておきたかったWeb技術の学び方の学び方 | リブセンス学生時代に知っておきたかったWeb技術の学び方の学び方 | リブセンス
学生時代に知っておきたかったWeb技術の学び方の学び方 | リブセンスLivesense Inc.
 

Destaque (8)

Stateモナドの解説 前編
Stateモナドの解説 前編Stateモナドの解説 前編
Stateモナドの解説 前編
 
モナモナ言うモナド入門
モナモナ言うモナド入門モナモナ言うモナド入門
モナモナ言うモナド入門
 
すごいMonad入門
すごいMonad入門すごいMonad入門
すごいMonad入門
 
null使ったら負け福岡版
null使ったら負け福岡版null使ったら負け福岡版
null使ったら負け福岡版
 
関数型プログラミングとモナド
関数型プログラミングとモナド関数型プログラミングとモナド
関数型プログラミングとモナド
 
Sano tokyowebmining 201625_v04
Sano tokyowebmining 201625_v04Sano tokyowebmining 201625_v04
Sano tokyowebmining 201625_v04
 
Building GUI App with Electron and Lisp
Building GUI App with Electron and LispBuilding GUI App with Electron and Lisp
Building GUI App with Electron and Lisp
 
学生時代に知っておきたかったWeb技術の学び方の学び方 | リブセンス
学生時代に知っておきたかったWeb技術の学び方の学び方 | リブセンス学生時代に知っておきたかったWeb技術の学び方の学び方 | リブセンス
学生時代に知っておきたかったWeb技術の学び方の学び方 | リブセンス
 

Semelhante a 循環参照のはなし

Functional Pe(a)rls version 2
Functional Pe(a)rls version 2Functional Pe(a)rls version 2
Functional Pe(a)rls version 2osfameron
 
Introdução ao Perl 6
Introdução ao Perl 6Introdução ao Perl 6
Introdução ao Perl 6garux
 
The Art of Transduction
The Art of TransductionThe Art of Transduction
The Art of TransductionDavid Stockton
 
Document Classification In PHP
Document Classification In PHPDocument Classification In PHP
Document Classification In PHPIan Barber
 
Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Kang-min Liu
 
Taking Perl to Eleven with Higher-Order Functions
Taking Perl to Eleven with Higher-Order FunctionsTaking Perl to Eleven with Higher-Order Functions
Taking Perl to Eleven with Higher-Order FunctionsDavid Golden
 
Wx::Perl::Smart
Wx::Perl::SmartWx::Perl::Smart
Wx::Perl::Smartlichtkind
 
Neatly Hashing a Tree: FP tree-fold in Perl5 & Perl6
Neatly Hashing a Tree: FP tree-fold in Perl5 & Perl6Neatly Hashing a Tree: FP tree-fold in Perl5 & Perl6
Neatly Hashing a Tree: FP tree-fold in Perl5 & Perl6Workhorse Computing
 
How to stand on the shoulders of giants
How to stand on the shoulders of giantsHow to stand on the shoulders of giants
How to stand on the shoulders of giantsIan Barber
 
20 modules i haven't yet talked about
20 modules i haven't yet talked about20 modules i haven't yet talked about
20 modules i haven't yet talked aboutTatsuhiko Miyagawa
 
Operation Oriented Web Applications / Yokohama pm7
Operation Oriented Web Applications / Yokohama pm7Operation Oriented Web Applications / Yokohama pm7
Operation Oriented Web Applications / Yokohama pm7Masahiro Nagano
 
Document Classification In PHP - Slight Return
Document Classification In PHP - Slight ReturnDocument Classification In PHP - Slight Return
Document Classification In PHP - Slight ReturnIan Barber
 
PHP Functions & Arrays
PHP Functions & ArraysPHP Functions & Arrays
PHP Functions & ArraysHenry Osborne
 
Introduction to CloudForecast / YAPC::Asia 2010 Tokyo
Introduction to CloudForecast / YAPC::Asia 2010 TokyoIntroduction to CloudForecast / YAPC::Asia 2010 Tokyo
Introduction to CloudForecast / YAPC::Asia 2010 TokyoMasahiro Nagano
 
Modern Application Foundations: Underscore and Twitter Bootstrap
Modern Application Foundations: Underscore and Twitter BootstrapModern Application Foundations: Underscore and Twitter Bootstrap
Modern Application Foundations: Underscore and Twitter BootstrapHoward Lewis Ship
 
Ruby closures, how are they possible?
Ruby closures, how are they possible?Ruby closures, how are they possible?
Ruby closures, how are they possible?Carlos Alonso Pérez
 
Perl Bag of Tricks - Baltimore Perl mongers
Perl Bag of Tricks  -  Baltimore Perl mongersPerl Bag of Tricks  -  Baltimore Perl mongers
Perl Bag of Tricks - Baltimore Perl mongersbrian d foy
 

Semelhante a 循環参照のはなし (20)

Functional Pe(a)rls version 2
Functional Pe(a)rls version 2Functional Pe(a)rls version 2
Functional Pe(a)rls version 2
 
Introdução ao Perl 6
Introdução ao Perl 6Introdução ao Perl 6
Introdução ao Perl 6
 
The Art of Transduction
The Art of TransductionThe Art of Transduction
The Art of Transduction
 
Document Classification In PHP
Document Classification In PHPDocument Classification In PHP
Document Classification In PHP
 
Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)
 
Taking Perl to Eleven with Higher-Order Functions
Taking Perl to Eleven with Higher-Order FunctionsTaking Perl to Eleven with Higher-Order Functions
Taking Perl to Eleven with Higher-Order Functions
 
PHP Tips & Tricks
PHP Tips & TricksPHP Tips & Tricks
PHP Tips & Tricks
 
Wx::Perl::Smart
Wx::Perl::SmartWx::Perl::Smart
Wx::Perl::Smart
 
Neatly Hashing a Tree: FP tree-fold in Perl5 & Perl6
Neatly Hashing a Tree: FP tree-fold in Perl5 & Perl6Neatly Hashing a Tree: FP tree-fold in Perl5 & Perl6
Neatly Hashing a Tree: FP tree-fold in Perl5 & Perl6
 
Mips1
Mips1Mips1
Mips1
 
How to stand on the shoulders of giants
How to stand on the shoulders of giantsHow to stand on the shoulders of giants
How to stand on the shoulders of giants
 
20 modules i haven't yet talked about
20 modules i haven't yet talked about20 modules i haven't yet talked about
20 modules i haven't yet talked about
 
Dades i operadors
Dades i operadorsDades i operadors
Dades i operadors
 
Operation Oriented Web Applications / Yokohama pm7
Operation Oriented Web Applications / Yokohama pm7Operation Oriented Web Applications / Yokohama pm7
Operation Oriented Web Applications / Yokohama pm7
 
Document Classification In PHP - Slight Return
Document Classification In PHP - Slight ReturnDocument Classification In PHP - Slight Return
Document Classification In PHP - Slight Return
 
PHP Functions & Arrays
PHP Functions & ArraysPHP Functions & Arrays
PHP Functions & Arrays
 
Introduction to CloudForecast / YAPC::Asia 2010 Tokyo
Introduction to CloudForecast / YAPC::Asia 2010 TokyoIntroduction to CloudForecast / YAPC::Asia 2010 Tokyo
Introduction to CloudForecast / YAPC::Asia 2010 Tokyo
 
Modern Application Foundations: Underscore and Twitter Bootstrap
Modern Application Foundations: Underscore and Twitter BootstrapModern Application Foundations: Underscore and Twitter Bootstrap
Modern Application Foundations: Underscore and Twitter Bootstrap
 
Ruby closures, how are they possible?
Ruby closures, how are they possible?Ruby closures, how are they possible?
Ruby closures, how are they possible?
 
Perl Bag of Tricks - Baltimore Perl mongers
Perl Bag of Tricks  -  Baltimore Perl mongersPerl Bag of Tricks  -  Baltimore Perl mongers
Perl Bag of Tricks - Baltimore Perl mongers
 

Mais de Masahiro Honma

レンズ (ぶつかり稽古の没プレゼン)
レンズ (ぶつかり稽古の没プレゼン)レンズ (ぶつかり稽古の没プレゼン)
レンズ (ぶつかり稽古の没プレゼン)Masahiro Honma
 
すべてが@__kanになる
すべてが@__kanになるすべてが@__kanになる
すべてが@__kanになるMasahiro Honma
 
Types and perl language
Types and perl languageTypes and perl language
Types and perl languageMasahiro Honma
 
カレーとHokkaidopm
カレーとHokkaidopmカレーとHokkaidopm
カレーとHokkaidopmMasahiro Honma
 
モナモナ言うモナド入門.tar.gz
モナモナ言うモナド入門.tar.gzモナモナ言うモナド入門.tar.gz
モナモナ言うモナド入門.tar.gzMasahiro Honma
 
Hachioji.pm in Machida の LT
Hachioji.pm in Machida の LTHachioji.pm in Machida の LT
Hachioji.pm in Machida の LTMasahiro Honma
 
ウヰスキーとPSGI
ウヰスキーとPSGIウヰスキーとPSGI
ウヰスキーとPSGIMasahiro Honma
 
モデルから知るGit
モデルから知るGitモデルから知るGit
モデルから知るGitMasahiro Honma
 
YAPCレポートの舞台裏
YAPCレポートの舞台裏YAPCレポートの舞台裏
YAPCレポートの舞台裏Masahiro Honma
 
Stateモナドの解説 後編
Stateモナドの解説 後編Stateモナドの解説 後編
Stateモナドの解説 後編Masahiro Honma
 
Stateモナドの解説 中編
Stateモナドの解説 中編Stateモナドの解説 中編
Stateモナドの解説 中編Masahiro Honma
 

Mais de Masahiro Honma (20)

レンズ (ぶつかり稽古の没プレゼン)
レンズ (ぶつかり稽古の没プレゼン)レンズ (ぶつかり稽古の没プレゼン)
レンズ (ぶつかり稽古の没プレゼン)
 
すべてが@__kanになる
すべてが@__kanになるすべてが@__kanになる
すべてが@__kanになる
 
Types and perl language
Types and perl languageTypes and perl language
Types and perl language
 
Currying in perl
Currying in perlCurrying in perl
Currying in perl
 
カレーとHokkaidopm
カレーとHokkaidopmカレーとHokkaidopm
カレーとHokkaidopm
 
モナモナ言うモナド入門.tar.gz
モナモナ言うモナド入門.tar.gzモナモナ言うモナド入門.tar.gz
モナモナ言うモナド入門.tar.gz
 
Perl saved a lady.
Perl saved a lady.Perl saved a lady.
Perl saved a lady.
 
Levenshtein Automata
Levenshtein AutomataLevenshtein Automata
Levenshtein Automata
 
20120526 hachioji.pm
20120526 hachioji.pm20120526 hachioji.pm
20120526 hachioji.pm
 
Arrows in perl
Arrows in perlArrows in perl
Arrows in perl
 
Hachioji.pm in Machida の LT
Hachioji.pm in Machida の LTHachioji.pm in Machida の LT
Hachioji.pm in Machida の LT
 
Monads in perl
Monads in perlMonads in perl
Monads in perl
 
ウヰスキーとPSGI
ウヰスキーとPSGIウヰスキーとPSGI
ウヰスキーとPSGI
 
モデルから知るGit
モデルから知るGitモデルから知るGit
モデルから知るGit
 
YAPCレポートの舞台裏
YAPCレポートの舞台裏YAPCレポートの舞台裏
YAPCレポートの舞台裏
 
Git入門
Git入門Git入門
Git入門
 
AnyEvent and Plack
AnyEvent and PlackAnyEvent and Plack
AnyEvent and Plack
 
Math::Category
Math::CategoryMath::Category
Math::Category
 
Stateモナドの解説 後編
Stateモナドの解説 後編Stateモナドの解説 後編
Stateモナドの解説 後編
 
Stateモナドの解説 中編
Stateモナドの解説 中編Stateモナドの解説 中編
Stateモナドの解説 中編
 

Último

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 

Último (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 

循環参照のはなし

  • 3.
  • 4. my ($ref1, $ref2, $ref3); $ref1 = $ref2; $ref2 = $ref3; $ref3 = $ref1; $ref1 $ref2 $ref3
  • 5. GC Perl GC
  • 10. reference counting 1 1 1 1 2 1 2 1
  • 11. reference counting 1 0 1 1 2 1 2 1
  • 12. reference counting 1 0 1 0 1 1 2 1
  • 13. reference counting 1 0 1 0 1 1 1 1
  • 14. reference counting 1 0 1 0 1 Leak 1 1 1
  • 15. (1) Template::Plugin::Filter (TT-2.2) Template::Plugin return $self->{ _STATIC_FILTER } ||= sub { $self->filter(shift); };
  • 16. (2) AnyEvent my $t; $t = AE::timer 1, 0, sub { ...; undef $t; }; $t sub { ... }
  • 17. (2) AnyEvent my $t; $t = AE::timer 1, 0, sub { ...; undef $t; }; $t sub { ... }
  • 18. (2) AnyEvent my $t; $t = AE::timer 1, 0, sub { ...; undef $t; }; $t
  • 19. (2) AnyEvent my $t; $t = AE::timer 1, 0, sub { ...; undef $t; }; $t
  • 20. (2) AnyEvent my $t; $t = AE::timer 1, 0, sub { ...; undef $t; };
  • 21. (3) my ($f, $x); (sub { $f = sub { $x } })->(); OUTSIDE sub {...} $f == sub { ... }
  • 22. (3) use Devel::Peek; Dump($f); SV = IV(0x100827fd8) at 0x100827fe0 REFCNT = 2 RV = 0x100827878 SV = PVCV(0x10082b5f8) at 0x100827878 REFCNT = 1 GVGV::GV = 0x100856bc0 "main" :: "__ANON__" OUTSIDE = 0x1008032a0 (ANON) SV = PVCV(0x100852a90) at 0x1008032a0 REFCNT = 1 GVGV::GV = 0x100856bc0 "main" :: "__ANON__" PADNAME = 0x1008277e8(0x100287000) PAD = 0x100827800(0x10025c0e0) 1. 0x100827fe0<2> FAKE "$f" flags=0x0 index=1
  • 23. 5 ( ≒ )
  • 24. 1) ps % perl for (1 .. 10000) { my $ref; $ref = $ref; warn `ps -o rss= -p $$` if $_ % 1000 == 0; } 1272 1304 1328 1352 1376 ...
  • 26. 2) Test::LeakTrace use Test::LeakTrace; no_leaks_ok { my $ref; $ref = $ref }; not ok 1 - leaks 1 <= 0 # Failed test 'leaks 1 <= 0' # at - line 4. # '1' # <= # '0' # leaked REF(0x10083b610) from - line 4. # SV = IV(0x10083b608) at 0x10083b610 # REFCNT = 1 # FLAGS = (PADMY,ROK) # RV = 0x10083b610 # SV = IV(0x10083b608) at 0x10083b610 # REFCNT = 1 # FLAGS = (PADMY,ROK) # RV = 0x10083b610 # SV = IV(0x10083b608) at 0x10083b610 # REFCNT = 1 # FLAGS = (PADMY,ROK) # RV = 0x10083b610 # SV = IV(0x10083b608) at 0x10083b610 ...
  • 27. 3) Devel::Cycle use Devel::Cycle; my ($ref1, $ref2, $ref3); $ref1 = $ref2; $ref2 = sub { $ref3 }; $ref3 = [$ref1]; find_cycle($ref1); Cycle (1): $$A => &B $B variable $ref3 => $C $$C => @D $D->[0] => $A
  • 28. 4) Devel::Leak::Object use Devel::Leak::Object qw{GLOBAL_bless}; $Devel::Leak::Object::TRACKSOURCELINES = 1; my $ref; $ref = bless $ref => "XXX"; Tracked objects by class: XXX 1 Sources of leaks: XXX 1 from - line: 3
  • 29. 5) DESTROY sub Ref1::DESTROY { warn "destroyed REF1" } sub Ref2::DESTROY { warn "destroyed REF2" } my $x; my $f = bless sub { $x; bless sub { $x } => "Ref2"; } => "Ref1"; $f->(); destroyed REF2 at - line 2. destroyed REF1 at - line 1.
  • 31. 5
  • 32. $self sub { ... }
  • 33. my $self = {name => "Hokkaido.pm", handler => undef}; $self->{handler} = sub { print "Hello, ", $self->{name}, ".n"; }; $self->{handler}->(); sub { ... } $self “Hokkaido.pm”
  • 34. 1) my $self = {name => "Hokkaido.pm", handler => undef}; $self->{handler} = sub { print "Hello, ", $self->{name}, ".n"; undef $self; }; $self->{handler}->(); sub { ... } $self “Hokkaido.pm”
  • 35. 1) my $self = {name => "Hokkaido.pm", handler => undef}; $self->{handler} = sub { print "Hello, ", $self->{name}, ".n"; undef $self; }; $self->{handler}->(); sub { ... } $self “Hokkaido.pm”
  • 36. 1) my $self = {name => "Hokkaido.pm", handler => undef}; $self->{handler} = sub { print "Hello, ", $self->{name}, ".n"; undef $self; }; $self->{handler}->(); sub { ... } “Hokkaido.pm”
  • 37. 1) my $self = {name => "Hokkaido.pm", handler => undef}; $self->{handler} = sub { print "Hello, ", $self->{name}, ".n"; undef $self; }; $self->{handler}->(); sub { ... } “Hokkaido.pm”
  • 38. 1) my $self = {name => "Hokkaido.pm", handler => undef}; $self->{handler} = sub { print "Hello, ", $self->{name}, ".n"; undef $self; }; $self->{handler}->();
  • 39. 1) ( ) ($self->{handler} )
  • 40. 2) Scalar::Util::weaken my $self = {name => "Hokkaido.pm", handler => undef}; Scalar::Util::weaken(my $weaken_self = $self); $self->{handler} = sub { print "Hello, ", $weaken_self->{name}, ".n"; }; $self->{handler}->(); sub { ... } $self “Hokkaido.pm”
  • 41. 2) Scalar::Util::weaken my $self = {name => "Hokkaido.pm", handler => undef}; Scalar::Util::weaken($self); # $self->{handler} = sub { print "Hello, ", $self->{name}, ".n"; }; $self->{handler}->();
  • 42. 3) my $self = {name => "Hokkaido.pm", handler => undef}; my $name = $self->{name}; $self->{handler} = sub { print "Hello, ", $name, ".n"; }; $self->{handler}->(); sub { ... } $self “Hokkaido.pm”
  • 43. 4) my $self = {name => "Hokkaido.pm", handler => undef}; $self->{handler} = sub { my $self = shift; print "Hello, ", $self->{name}, ".n"; }; $self->{handler}->($self); sub { ... } $self “Hokkaido.pm”
  • 44. 4) AnyEvent::Handler $hdl->push_read (line => sub { my ($hdl, $line) = @_; ... });
  • 45. 5) Data::Decycle use Data::Decycle; my $guard = Data::Decycle->new( my $self = {name => "Hokkaido.pm", handler => undef} ); $self->{handler} = sub { "Hello, ", $self->{name}, ".n"; }; $self->{handler}->();
  • 47.
  • 48. :Perl 5.8.8 use Devel::Leak::Object qw{GLOBAL_bless}; bless my $x = {}, "Dummy"; (sub { sub { $x } })->(); Tracked objects by class: Dummy 1
  • 49. :Perl 5.8.8 my $x = bless {}, "Dummy"; (sub { $x; sub { $x } })->(); my $x = bless {}, "Dummy"; (sub { my $x = $x; sub { warn $x } })->();
  • 50.
  • 51. :Obj-C ARC retain release Perl CBRFuture *future = [[CBRFuture alloc] init]; __weak CBRFuture *weakenFuture = future; leftHandle(self, ^(id e) { current = nil; leftSend(weakenFuture, e); });
  • 52. :Obj-C Guard NSString *local = @"OK"; static void changeLocalValue(BOOL willBreak) { id original = local; CBRGuard *guard = [[CBRGuard alloc] initGuard:^{ local = original; }]; local = @"LOCALVALUE1"; }
  • 53. :Obj-C Guard autorelease

Notas do Editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. &amp;#x3010;5&amp;#x5206;&amp;#x3011;\n
  17. &amp;#x3010;5&amp;#x5206;&amp;#x3011;\n
  18. &amp;#x3010;5&amp;#x5206;&amp;#x3011;\n
  19. &amp;#x3010;5&amp;#x5206;&amp;#x3011;\n
  20. \n
  21. \n
  22. \n
  23. &amp;#x3088;&amp;#x3044;: &amp;#x30EA;&amp;#x30FC;&amp;#x30AF;&amp;#x3057;&amp;#x3066;&amp;#x308B;&amp;#x304B;&amp;#x306E;&amp;#x5224;&amp;#x5B9A;&amp;#x3068;&amp;#x3057;&amp;#x3066;&amp;#x306F;&amp;#x6027;&amp;#x683C;&amp;#x3001;&amp;#x308F;&amp;#x308B;&amp;#x3044;: &amp;#x539F;&amp;#x59CB;&amp;#x7684;&amp;#x3001;&amp;#x74B0;&amp;#x5883;&amp;#x4F9D;&amp;#x5B58;\n
  24. &amp;#x3088;&amp;#x3044;: &amp;#x30EA;&amp;#x30FC;&amp;#x30AF;&amp;#x5168;&amp;#x822C;&amp;#x3092;&amp;#x898B;&amp;#x3064;&amp;#x3051;&amp;#x3089;&amp;#x308C;&amp;#x308B;&amp;#x3001;&amp;#x308F;&amp;#x308B;&amp;#x3044;: &amp;#x7D50;&amp;#x679C;&amp;#x306E;&amp;#x8868;&amp;#x793A;&amp;#x304C;&amp;#x3054;&amp;#x3064;&amp;#x3044;\n
  25. &amp;#x3088;&amp;#x3044;: &amp;#x7D50;&amp;#x679C;&amp;#x304C;&amp;#x307F;&amp;#x3084;&amp;#x3059;&amp;#x3044;&amp;#x3001;&amp;#x3060;&amp;#x3081;: &amp;#x5FAA;&amp;#x74B0;&amp;#x53C2;&amp;#x7167;&amp;#x3092;&amp;#x63A2;&amp;#x3059;&amp;#x3060;&amp;#x3051;&amp;#x3002;XS&amp;#x306E;&amp;#x30EA;&amp;#x30FC;&amp;#x30AF;&amp;#x306F;&amp;#x691C;&amp;#x51FA;&amp;#x3067;&amp;#x304D;&amp;#x306A;&amp;#x3044;&amp;#x3002;OUTER&amp;#x7D61;&amp;#x307F;&amp;#x3082;&amp;#x7121;&amp;#x7406;&amp;#x307D;&amp;#x3002;\n\n
  26. &amp;#x3088;&amp;#x3044;: &amp;#x7C21;&amp;#x5358;&amp;#x306B;&amp;#x30EA;&amp;#x30FC;&amp;#x30AF;&amp;#x691C;&amp;#x51FA;&amp;#x3001; &amp;#x308F;&amp;#x308B;&amp;#x3044;: &amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x9650;&amp;#x5B9A;\n
  27. &amp;#x3010;10&amp;#x5206;&amp;#x3011;&amp;#x3088;&amp;#x3044;: &amp;#x89E3;&amp;#x653E;&amp;#x30BF;&amp;#x30A4;&amp;#x30DF;&amp;#x30F3;&amp;#x30B0;&amp;#x304C;&amp;#x6B63;&amp;#x78BA;&amp;#x306B;&amp;#x308F;&amp;#x304B;&amp;#x308B;(&amp;#x4E2D;&amp;#x306E;&amp;#x30AF;&amp;#x30ED;&amp;#x30FC;&amp;#x30B8;&amp;#x30E3;&amp;#x304B;&amp;#x3089;&amp;#x89E3;&amp;#x653E;&amp;#x3055;&amp;#x308C;&amp;#x308B;) &amp;#x308F;&amp;#x308B;&amp;#x3044;: &amp;#x3072;&amp;#x3069;&amp;#x3044;&amp;#x30CF;&amp;#x30C3;&amp;#x30AF;\n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. &amp;#x3010;15&amp;#x5206;&amp;#x3011;undef &amp;#x30A8;&amp;#x30E9;&amp;#x30FC;&amp;#x306E;&amp;#x539F;&amp;#x56E0;&amp;#x3068;&amp;#x306A;&amp;#x308B;&amp;#x3002;&amp;#x3053;&amp;#x306E;&amp;#x4F8B;&amp;#x3060;&amp;#x3068;&amp;#x30EA;&amp;#x30FC;&amp;#x30AF;&amp;#x3059;&amp;#x308B;&amp;#x3002;\n
  41. &amp;#x3053;&amp;#x306E;&amp;#x4F8B;&amp;#x3060;&amp;#x3068;&amp;#x3001;weaken&amp;#x3088;&amp;#x308A;&amp;#x3053;&amp;#x3061;&amp;#x3089;&amp;#x304C;&amp;#x81EA;&amp;#x7136;\n
  42. API&amp;#x3092;&amp;#x5909;&amp;#x66F4;&amp;#x3057;&amp;#x3001;&amp;#x30AF;&amp;#x30ED;&amp;#x30FC;&amp;#x30B8;&amp;#x30E3;&amp;#x3092;&amp;#x6E21;&amp;#x3055;&amp;#x305A;&amp;#x306B;&amp;#x3059;&amp;#x3080;&amp;#x3088;&amp;#x3046;&amp;#x306B;&amp;#x3059;&amp;#x308B;\n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. &amp;#x7532;&amp;#x6590;&amp;#x4E92;&amp;#x63DB;&amp;#x306E;&amp;#x305F;&amp;#x3081;&amp;#x306B;autorelease &amp;#x3067;&amp;#x8FD4;&amp;#x3057;&amp;#x3066;&amp;#x304F;&amp;#x308B;&amp;#x3053;&amp;#x3068;&amp;#x304C;&amp;#x3042;&amp;#x308B;&amp;#x304C;&amp;#x3001;&amp;#x305D;&amp;#x308C;&amp;#x3060;&amp;#x3068;&amp;#x3046;&amp;#x307E;&amp;#x304F;&amp;#x3044;&amp;#x304B;&amp;#x306A;&amp;#x3044;&amp;#x3002;&amp;#x4ED5;&amp;#x69D8;&amp;#x3092;&amp;#x3088;&amp;#x304F;&amp;#x8ABF;&amp;#x3079;&amp;#x308B;&amp;#x5FC5;&amp;#x8981;&amp;#x3042;&amp;#x308A;&amp;#x3002;\n
  52. \n