ARTのメモリ管理

45fec3b965f9269bc8d6d2cf5bd93a13?s=47 haru067
April 25, 2015

 ARTのメモリ管理

45fec3b965f9269bc8d6d2cf5bd93a13?s=128

haru067

April 25, 2015
Tweet

Transcript

  1. "35ͷϝϞϦ؅ཧ %SPJE,BJHJ!IBSV

  2. ࣗݾ঺հ ˔ 5XJUUFSΫϥΠΞϯτ
 4IPPUJOH4UBSͷ։ൃऀ !IBSV

  3. ࣗݾ঺հ ˔ 5XJUUFSΫϥΠΞϯτ
 4IPPUJOH4UBSͷ։ൃऀ
 ʢͨ·ʹ͸ਅ໘໨ͳ࿩Λʣ !IBSV

  4. "OESPJEͷ($ͷྺ࢙   Y   %BMWJL7. "35

  5. "OESPJEͷ($ͷྺ࢙ 'SPZP ˔ ϚʔΫεΠʔϓ($ ˔ ($த͸ΞϓϦέʔγϣϯ͕ఀࢭͯ͠͠·͏
 ʢ458ɼ4UPQ5IF8PSMEʣ   Y

      %BMWJL7. "35
  6. "OESPJEͷ($ͷྺ࢙ (JOHFSCSFBE ˔ .PTUMZ$PODVSSFOU($ ˔ ϚʔΫεΠʔϓ($ΛΞϓϦέʔγϣϯͱ
 ΄΅ฒߦʹ࣮ߦɽఀࢭ࣌ؒ͸େ͖͘վળ   Y

      %BMWJL7. "35
  7. "OESPJEͷ($ͷྺ࢙ Y*$4 +FMMZ#FBO ˔ େ͖ͳมߋ͸ͳ͠ ˔ .PTUMZ$PODVSSFOU($
 ʢฒߦϚʔΫεΠʔϓ($ʣ  

    Y   %BMWJL7. "35
  8. "OESPJEͷ($ͷྺ࢙ ,JULBU ˔ "35ͳΔϥϯλΠϜ͕ग़ݱ ˔ σϑΥϧτ͸·ͩ%BMWJL7.   Y 

     %BMWJL7. "35
  9. "OESPJEͷ($ͷྺ࢙ -PMMJQPQ ˔ "35͕σϑΥϧτʹɼ%BMWJL͸രൃ࢛ࢄ ˔ ϥϯλΠϜ͕ସΘͬͯ($ͱ͔৭ʑͱมΘͬͨ   Y 

     %BMWJL7. "35
  10. Կ͕มΘͬͨͷ͔ʁ

  11. ฒߦ($ͷఀࢭ࣌ؒ

  12. %BMWJL7. ˔ ϧʔτεΩϟϯͱ࠶ϚʔΫͰΞϓϦ͕ఀࢭ͢Δ "35 ˔ ϧʔτεΩϟϯͱ࠶ϚʔΫͷҰ෦Λฒߦʹॲཧ ͕͜͜มΘͬͨɿฒߦ($ͷఀࢭՕॴ ϧʔτ
 εΩϟϯ ϚʔΫ

    ࠶ϚʔΫ εΠʔϓ ϧʔτ
 εΩϟϯ ϚʔΫ ࠶ϚʔΫ εΠʔϓ
  13. %BMWJL7. ˔ ϧʔτεΩϟϯͱ࠶ϚʔΫͰΞϓϦ͕ఀࢭ͢Δ "35 ˔ ϧʔτεΩϟϯͱ࠶ϚʔΫͷҰ෦Λฒߦʹॲཧ ͕͜͜มΘͬͨɿฒߦ($ͷఀࢭՕॴ ϧʔτ
 εΩϟϯ ϚʔΫ

    ࠶ϚʔΫ εΠʔϓ ϧʔτ
 εΩϟϯ ϚʔΫ ࠶ϚʔΫ εΠʔϓ dϛϦඵ͙Β͍
  14. %BMWJL7. ˔ ϧʔτεΩϟϯͱ࠶ϚʔΫͰΞϓϦ͕ఀࢭ͢Δ "35 ˔ ϧʔτεΩϟϯͱ࠶ϚʔΫͷҰ෦Λฒߦʹॲཧ ͕͜͜มΘͬͨɿฒߦ($ͷఀࢭՕॴ ϧʔτ
 εΩϟϯ ϚʔΫ

    ࠶ϚʔΫ εΠʔϓ ϧʔτ
 εΩϟϯ ϚʔΫ ࠶ϚʔΫ εΠʔϓ
  15. %BMWJL7. ˔ ϧʔτεΩϟϯͱ࠶ϚʔΫͰΞϓϦ͕ఀࢭ͢Δ "35 ˔ ϧʔτεΩϟϯͱ࠶ϚʔΫͷҰ෦Λฒߦʹॲཧ ͕͜͜มΘͬͨɿฒߦ($ͷఀࢭՕॴ ϧʔτ
 εΩϟϯ ϚʔΫ

    ࠶ϚʔΫ εΠʔϓ ϧʔτ
 εΩϟϯ ϚʔΫ ࠶ϚʔΫ εΠʔϓ ϛϦඵ͙Β͍
  16. "35ͷฒߦ($εΰΠʂ

  17. ฒߦ͡Όͳ͍΄͏͸ʁ ˔ 458($ ˔ MPHDBUʹग़ͯ͘Δ($@'03@"--0$͸͜Ε ˔ ϝϞϦྖҬ͕ෆ଍͢Δͱൃੜ ˔ ฏؾͰΞϓϦ͕਺ඵࢭ·ͬͨΓ͢Δ ൃੜ͢Δͱ໌Β͔ʹϠό͍

  18. ฒߦ͡Όͳ͍΄͏͸ʁ ˔ 458($ ˔ MPHDBUʹग़ͯ͘Δ($@'03@"--0$͸͜Ε ˔ ϝϞϦྖҬ͕ෆ଍͢Δͱൃੜ ˔ ฏؾͰΞϓϦ͕਺ඵࢭ·ͬͨΓ͢Δ ൃੜ͢Δͱ໌Β͔ʹϠό͍

  19. ϩάݟΔͱׂͱൃੜͯͨ͠Γ͢Δ

  20. ʀʅЧʆ

  21. 458($ͷൃੜݪҼͦͷ̍ ˔ அยԽʹΑΔϝϞϦׂ౰ͯͷࣦഊ
 ʮۭ͍ͯΔͱ͜Ζ͸νϥϗϥ͋Δ͚ͲೖΒͳ͍ʯ ˔ ΞϓϦέʔγϣϯ͸͝ΈͷճऩΛ଴ͨͳ͍ͱ͍ ͚ͳ͍ ώʔϓ ۭ͖ྖҬ ࢖༻த

    PCK ʁ
  22. ʁ

  23. σϑϥά͢Ε͹͍͍͡ΌΜ ˔ σϑϥάʹ͸ੌ͍͕͔͔࣌ؒΔ ˔ ώʔϓΛԿ౓΋εΩϟϯ͢Δඞཁ͕͋Δ ˔ σϑϥά͍ͯ͠ΔؒΞϓϦέʔγϣϯ͕ఀࢭ ˔ ͱͯ΋ͭΒ͍

  24. "35͸Ͳ͏ͯ͠Δͷ ˔ େ͖͍ΦϒδΣΫτ͕ॾѱͷࠜݯ ώʔϓ ۭ͖ྖҬ ࢖༻த PCK

  25. "35͸Ͳ͏ͯ͠Δͷ ˔ େ͖͍ΦϒδΣΫτ͕ॾѱͷࠜݯ
 ʮσϒ͸ిंʹ৐Δͳʯ ώʔϓ ۭ͖ྖҬ ࢖༻த PCK

  26. ͕͜͜มΘͬͨɿஅยԽରࡦ ˔ େ͖͍ΦϒδΣΫτΛผͷྖҬͰ؅ཧ
 ʮσϒઐ༻ं྆Λͭ͘Ζ͏ʯ ˔ -BSHF0CKFDU4QBDFʢ-04ʣ ௨ৗ༻ ۭ͖ྖҬ ࢖༻த Ͱ͔͍΍ͭΒʢେ͖Ίͷ഑ྻͱ͔ʣ༻

  27. "35͕Μ͹ͬͯΔ

  28. 458($ͷൃੜݪҼͦͷ̎ ˔ ϝϞϦׂ౰͕ܹͯͯ͘͠ฒߦ($͕௥͍͔ͭͳ͍ ΞϓϦ࣮ߦ

  29. 458($ͷൃੜݪҼͦͷ̎ ˔ ϝϞϦׂ౰͕ܹͯͯ͘͠ฒߦ($͕௥͍͔ͭͳ͍ ฒߦ($ ΞϓϦ࣮ߦ

  30. 458($ͷൃੜݪҼͦͷ̎ ˔ ϝϞϦׂ౰͕ܹͯͯ͘͠ฒߦ($͕௥͍͔ͭͳ͍ ฒߦ($ ΞϓϦ࣮ߦ ΞϓϦ࣮ߦ

  31. 458($ͷൃੜݪҼͦͷ̎ ˔ ϝϞϦׂ౰͕ܹͯͯ͘͠ฒߦ($͕௥͍͔ͭͳ͍ ฒߦ($ ΞϓϦ࣮ߦ ΞϓϦ࣮ߦ ฒߦ($

  32. 458($ͷൃੜݪҼͦͷ̎ ˔ ϝϞϦׂ౰͕ܹͯͯ͘͠ฒߦ($͕௥͍͔ͭͳ͍ ฒߦ($ ΞϓϦ࣮ߦ ΞϓϦ࣮ߦ ฒߦ($ ϝϞϦਚ͖·ͨ͠

  33. 458($ͷൃੜݪҼͦͷ̎ ˔ ϝϞϦׂ౰͕ܹͯͯ͘͠ฒߦ($͕௥͍͔ͭͳ͍ ฒߦ($ ΞϓϦ࣮ߦ ΞϓϦ࣮ߦ ฒߦ($ ϝϞϦਚ͖·ͨ͠ 458($

  34. 458($ͷൃੜݪҼͦͷ̎ ˔ ϝϞϦׂ౰͕ܹͯͯ͘͠ฒߦ($͕௥͍͔ͭͳ͍ ฒߦ($ ΞϓϦ࣮ߦ ΞϓϦ࣮ߦ ฒߦ($ ϝϞϦਚ͖·ͨ͠ 458($

  35. ฒߦ($ૣΊʹ΍Ε͹͍͍͡ΌΜ ˔ ͍͍ͩͨ͋ͬͯΔ ˔ "35͸%BMWJLΑΓݡ͘ฒߦ($Λ࣮ߦͯ͠Δ ˔ جຊతʹ͸ۭ͖ྖҬ͕Ұఆ஋Λ௒͑ͨΒ($ ˔ "35͸ϝϞϦׂ౰ͯස౓ͱ͔΋ߟྀͭͭ͠($

  36. "35͕Μ͹ͬͯΔ

  37. "35ͷఀࢭ࣌ؒ·ͱΊ ˔ ฒߦ($ͰɼΞϓϦΛఀࢭ্ͤͨ͞ͰͷॲཧΛ࡟ݮ ˔ 458($ͷൃੜස౓Λ཈͑Δ޻෉ ˔ -BSHF0CKFDU4QBDFʹΑΔஅยԽରࡦ ˔ ΑΓ͜·໨ʹɼલ΋ͬͯฒߦ($ ฏۉఀࢭ࣌ؒΛ୹͘

    ௕࣌ؒͷఀࢭΛ཈͑Δ
  38. ΊͰͨ͠ʁ

  39. ˔ 458($ͷൃੜ͸཈͑ΒΕΔ ˔ εϧʔϓοτʢ࣮ߦ࣌ؒʣ͸ѱ͘ͳΔ Ή΍Έʹฒߦ($Λ࣮ߦ͍͍ͯ͠ͷ͔ʁ

  40. ˔ 458($ͷൃੜ͸཈͑ΒΕΔ ˔ εϧʔϓοτʢ࣮ߦ࣌ؒʣ͸ѱ͘ͳΔ Ή΍Έʹฒߦ($Λ࣮ߦ͍͍ͯ͠ͷ͔ʁ ࣮ߦ࣌ؒ͸ͬͪ͜ͷ΄͏͕୹͍

  41. εϧʔϓοτ

  42. ͕͜͜มΘͬͨɿฒྻ($ ˔ ($ͷॲཧΛฒྻ࣮ߦͯ͠ߴ଎Խ ˔ ϚϧνίΞ$16౥ࡌ୺຤͕૿͑ͯΔ͜ͱͩ͠ ˔ ౓ͷ($ʹ͔͔Δ࣌ؒΛ୹ॖ ˔ ࠶ϚʔΫͷఀࢭ͢Δॲཧ΋୹͘ͳͬͯخ͍͠ ϧʔτ


    εΩϟϯ ϚʔΫ ࠶ϚʔΫ εΠʔϓ
  43. ͕͜͜มΘͬͨɿฒྻ($ ˔ ($ͷॲཧΛฒྻ࣮ߦͯ͠ߴ଎Խ ˔ ϚϧνίΞ$16౥ࡌ୺຤͕૿͑ͯΔ͜ͱͩ͠ ˔ ౓ͷ($ʹ͔͔Δ࣌ؒΛ୹ॖ ˔ ࠶ϚʔΫͷఀࢭ͢Δॲཧ΋୹͘ͳͬͯخ͍͠

  44. ͕͜͜มΘͬͨɿੈ୅ผ($ ˔ ଟ͘ͷΦϒδΣΫτ͸୹໋Ͱ͋Δɼͱ͍͏ԾઆΛ ར༻ͨ͠($ ˔ 4UJDLZNBSLCJUT($ ˔ લճͷ($Ҏ߱ʹ࡞ΒΕͨ͝Έ͚ͩճऩ ($ ($

  45. ͕͜͜มΘͬͨɿੈ୅ผ($ ˔ ଟ͘ͷΦϒδΣΫτ͸୹໋Ͱ͋Δɼͱ͍͏ԾઆΛ ར༻ͨ͠($ ˔ 4UJDLZNBSLCJUT($ ˔ લճͷ($Ҏ߱ʹ࡞ΒΕͨ͝Έ͚ͩճऩ ($ ($

    ($ର৅ ($ର৅֎
  46. ͕͜͜มΘͬͨɿੈ୅ผ($ ˔ ଟ͘ͷΦϒδΣΫτ͸୹໋Ͱ͋Δɼͱ͍͏ԾઆΛ ར༻ͨ͠($ ˔ 4UJDLZNBSLCJUT($ ˔ લճͷ($Ҏ߱ʹ࡞ΒΕͨ͝Έ͚ͩճऩ ($ ($

    ($ର৅ ($ର৅֎ ϐϯϙΠϯτͰ͝ΈΛճऩ
  47. ͕͜͜มΘͬͨɿΞϩέʔλ ˔ %BMWJL7.ɿEMNBMMPD ˔ HMJCDͷNBMMPDʢͷେݩʹͳͬͨΞϩέʔλʣ ˔ ฒߦϝϞϦׂ౰ͯ͸ϩοΫͰഉଞ੍ޚ ˔ "35ɿ3PT"MMPD ˔

    "35ಠࣗͷϝϞϦΞϩέʔλ ˔ 4FHSFHBUFEGSFFMJTU ˔ ฒߦϝϞϦׂ౰ͯʹରԠ
  48. ฒߦϝϞϦׂ౰ͯ ώʔϓ ۭ͖ྖҬ ࢖༻த εϨου εϨου

  49. ฒߦϝϞϦׂ౰ͯ ώʔϓ ۭ͖ྖҬ ࢖༻த εϨου new Object(); εϨου new Object();

  50. ·ͱΊ ˔ "35͕Μ͹ͬͯΔ

  51. ·ͱΊ ˔ "35͕Μ͹ͬͯΔ ˔ ͱ͍͏ΑΓ͸%BMWJL7.͕ΨόΨόͩͬͨʁ ˔ ͱʹ͔͘ؤுͬͯΔɼࠓޙʹ΋ظ଴

  52. ·ͱΊ ˔ ฒߦ($ͷఀࢭՕॴ͕ΑΓ୹͘ͳͬͨ ˔ 458($ͷൃੜස౓͕௿͘ͳͬͨ ˔ -BSHF0CKFDU4QBDFʹΑΔஅยԽରࡦ ˔ ͜·໨ʹฒߦ($ ˔

    εϧʔϓοτ΋վળ ˔ ฒߦ($ɼੈ୅ผ($ ˔ ϝϞϦׂ౰ͯͷฒߦॲཧʹରԠ ˔ 3PT"MMPD