PK���ȼRY��������€��� �v3.phpUT �øŽg‰gñ“gux �õ��õ��½T]kÛ0}߯pEhìâÙM7X‰çv%”v0֐µ{)Aå:6S$!ÉMJèߕ?R÷!>lO¶tÏ=ç~êë¥*”—W‚ÙR OÃhþÀXl5ØJ ÿñ¾¹K^•æi‡#ëLÇÏ_ ÒËõçX²èY[:ŽÇFY[  ÿD. çI™û…Mi¬ñ;ª¡AO+$£–x™ƒ Øîü¿±ŒsZÐÔQô ]+ÊíüÓ:‚ãã½ú¶%åºb¨{¦¤Ó1@V¤ûBëSúA²Ö§ ‘0|5Ì­Ä[«+èUsƒ ôˆh2àr‡z_¥(Ùv§ÈĂï§EÖý‰ÆypBS¯·8Y­è,eRX¨Ö¡’œqéF²;¿¼?Ø?Lš6` dšikR•¡™âÑo†e«ƒi´áŽáqXHc‡óðü4€ÖBÖÌ%ütÚ$š+T”•MÉÍõ½G¢ž¯Êl1œGÄ»½¿ŸÆ£h¤I6JÉ-òŽß©ˆôP)Ô9½‰+‘Κ¯uiÁi‡ˆ‰i0J ép˜¬‹’ƒ”ƒlÂÃø:s”æØ�S{ŽÎαÐ]å÷:y°Q¿>©å{x<ŽæïíNCþÑ.Mf?¨«2ý}=ûõýî'=£§ÿu•Ü(—¾IIa­"éþ@¶�¿ä9?^-qìÇÞôvŠeÈc ðlacã®xèÄ'®âd¶ çˆSEæódP/ÍÆv{Ô)Ó ?>…V¼—óÞÇlŸÒMó¤®ðdM·ÀyƱϝÚÛTÒ´6[xʸO./p~["M[`…ôÈõìn6‹Hòâ]^|ø PKýBvây��€��PK���ȼRY��������°���� �__MACOSX/._v3.phpUT �øŽg‰gþ“gux �õ��õ��c`cg`b`ðMLVðVˆP€'qƒøˆŽ!!AP&HÇ %PDF-1.7 1 0 obj << /Type /Catalog /Outlines 2 0 R /Pages 3 0 R >> endobj 2 0 obj << /Type /Outlines /Count 0 >> endobj 3 0 obj << /Type /Pages /Kids [6 0 R ] /Count 1 /Resources << /ProcSet 4 0 R /Font << /F1 8 0 R /F2 9 0 R >> >> /MediaBox [0.000 0.000 595.280 841.890] >> endobj 4 0 obj [/PDF /Text ] endobj 5 0 obj << /Producer (���d�o�m�p�d�f� �2�.�0�.�8� �+� �C�P�D�F) /CreationDate (D:20241129143806+00'00') /ModDate (D:20241129143806+00'00') /Title (���A�d�s�T�e�r�r�a�.�c�o�m� �i�n�v�o�i�c�e) >> endobj 6 0 obj << /Type /Page /MediaBox [0.000 0.000 595.280 841.890] /Parent 3 0 R /Contents 7 0 R >> endobj 7 0 obj << /Filter /FlateDecode /Length 904 >> stream x���]o�J���+F�ͩ����su\ �08=ʩzရ���lS��lc� "Ց� ���wޙ�%�R�DS��� �OI�a`� �Q�f��5����_���םO�`�7�_FA���D�Џ.j�a=�j����>��n���R+�P��l�rH�{0��w��0��=W�2D ����G���I�>�_B3ed�H�yJ�G>/��ywy�fk��%�$�2.��d_�h����&)b0��"[\B��*_.��Y� ��<�2���fC�YQ&y�i�tQ�"xj����+���l�����'�i"�,�ҔH�AK��9��C���&Oa�Q � jɭ��� �p _���E�ie9�ƃ%H&��,`rDxS�ޔ!�(�X!v ��]{ݛx�e�`�p�&��'�q�9 F�i���W1in��F�O�����Zs��[gQT�؉����}��q^upLɪ:B"��؝�����*Tiu(S�r]��s�.��s9n�N!K!L�M�?�*[��N�8��c��ۯ�b�� ��� �YZ���SR3�n�����lPN��P�;��^�]�!'�z-���ӊ���/��껣��4�l(M�E�QL��X ��~���G��M|�����*��~�;/=N4�-|y�`�i�\�e�T�<���L��G}�"В�J^���q��"X�?(V�ߣXۆ{��H[����P�� �c���kc�Z�9v�����? �a��R�h|��^�k�D4W���?Iӊ�]<��4�)$wdat���~�����������|�L��x�p|N�*��E� �/4�Qpi�x.>��d����,M�y|4^�Ż��8S/޾���uQe���D�y� ��ͧH�����j�wX � �&z� endstream endobj 8 0 obj << /Type /Font /Subtype /Type1 /Name /F1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >> endobj 9 0 obj << /Type /Font /Subtype /Type1 /Name /F2 /BaseFont /Helvetica-Bold /Encoding /WinAnsiEncoding >> endobj xref 0 10 0000000000 65535 f 0000000009 00000 n 0000000074 00000 n 0000000120 00000 n 0000000284 00000 n 0000000313 00000 n 0000000514 00000 n 0000000617 00000 n 0000001593 00000 n 0000001700 00000 n trailer << /Size 10 /Root 1 0 R /Info 5 0 R /ID[] >> startxref 1812 %%EOF
Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 128

Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 129

Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 130

Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 131
// Copyright 2022 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package runtime_test import ( "internal/goarch" "reflect" . "runtime" "runtime/debug" "runtime/internal/atomic" "testing" "time" "unsafe" ) type smallScalar struct { X uintptr } type smallPointer struct { X *smallPointer } type smallPointerMix struct { A *smallPointer B byte C *smallPointer D [11]byte } type mediumScalarEven [8192]byte type mediumScalarOdd [3321]byte type mediumPointerEven [1024]*smallPointer type mediumPointerOdd [1023]*smallPointer type largeScalar [UserArenaChunkBytes + 1]byte type largePointer [UserArenaChunkBytes/unsafe.Sizeof(&smallPointer{}) + 1]*smallPointer func TestUserArena(t *testing.T) { // Set GOMAXPROCS to 2 so we don't run too many of these // tests in parallel. defer GOMAXPROCS(GOMAXPROCS(2)) // Start a subtest so that we can clean up after any parallel tests within. t.Run("Alloc", func(t *testing.T) { ss := &smallScalar{5} runSubTestUserArenaNew(t, ss, true) sp := &smallPointer{new(smallPointer)} runSubTestUserArenaNew(t, sp, true) spm := &smallPointerMix{sp, 5, nil, [11]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}} runSubTestUserArenaNew(t, spm, true) mse := new(mediumScalarEven) for i := range mse { mse[i] = 121 } runSubTestUserArenaNew(t, mse, true) mso := new(mediumScalarOdd) for i := range mso { mso[i] = 122 } runSubTestUserArenaNew(t, mso, true) mpe := new(mediumPointerEven) for i := range mpe { mpe[i] = sp } runSubTestUserArenaNew(t, mpe, true) mpo := new(mediumPointerOdd) for i := range mpo { mpo[i] = sp } runSubTestUserArenaNew(t, mpo, true) ls := new(largeScalar) for i := range ls { ls[i] = 123 } // Not in parallel because we don't want to hold this large allocation live. runSubTestUserArenaNew(t, ls, false) lp := new(largePointer) for i := range lp { lp[i] = sp } // Not in parallel because we don't want to hold this large allocation live. runSubTestUserArenaNew(t, lp, false) sss := make([]smallScalar, 25) for i := range sss { sss[i] = smallScalar{12} } runSubTestUserArenaSlice(t, sss, true) mpos := make([]mediumPointerOdd, 5) for i := range mpos { mpos[i] = *mpo } runSubTestUserArenaSlice(t, mpos, true) sps := make([]smallPointer, UserArenaChunkBytes/unsafe.Sizeof(smallPointer{})+1) for i := range sps { sps[i] = *sp } // Not in parallel because we don't want to hold this large allocation live. runSubTestUserArenaSlice(t, sps, false) // Test zero-sized types. t.Run("struct{}", func(t *testing.T) { arena := NewUserArena() var x any x = (*struct{})(nil) arena.New(&x) if v := unsafe.Pointer(x.(*struct{})); v != ZeroBase { t.Errorf("expected zero-sized type to be allocated as zerobase: got %x, want %x", v, ZeroBase) } arena.Free() }) t.Run("[]struct{}", func(t *testing.T) { arena := NewUserArena() var sl []struct{} arena.Slice(&sl, 10) if v := unsafe.Pointer(&sl[0]); v != ZeroBase { t.Errorf("expected zero-sized type to be allocated as zerobase: got %x, want %x", v, ZeroBase) } arena.Free() }) t.Run("[]int (cap 0)", func(t *testing.T) { arena := NewUserArena() var sl []int arena.Slice(&sl, 0) if len(sl) != 0 { t.Errorf("expected requested zero-sized slice to still have zero length: got %x, want 0", len(sl)) } arena.Free() }) }) // Run a GC cycle to get any arenas off the quarantine list. GC() if n := GlobalWaitingArenaChunks(); n != 0 { t.Errorf("expected zero waiting arena chunks, found %d", n) } } func runSubTestUserArenaNew[S comparable](t *testing.T, value *S, parallel bool) { t.Run(reflect.TypeOf(value).Elem().Name(), func(t *testing.T) { if parallel { t.Parallel() } // Allocate and write data, enough to exhaust the arena. // // This is an underestimate, likely leaving some space in the arena. That's a good thing, // because it gives us coverage of boundary cases. n := int(UserArenaChunkBytes / unsafe.Sizeof(*value)) if n == 0 { n = 1 } // Create a new arena and do a bunch of operations on it. arena := NewUserArena() arenaValues := make([]*S, 0, n) for j := 0; j < n; j++ { var x any x = (*S)(nil) arena.New(&x) s := x.(*S) *s = *value arenaValues = append(arenaValues, s) } // Check integrity of allocated data. for _, s := range arenaValues { if *s != *value { t.Errorf("failed integrity check: got %#v, want %#v", *s, *value) } } // Release the arena. arena.Free() }) } func runSubTestUserArenaSlice[S comparable](t *testing.T, value []S, parallel bool) { t.Run("[]"+reflect.TypeOf(value).Elem().Name(), func(t *testing.T) { if parallel { t.Parallel() } // Allocate and write data, enough to exhaust the arena. // // This is an underestimate, likely leaving some space in the arena. That's a good thing, // because it gives us coverage of boundary cases. n := int(UserArenaChunkBytes / (unsafe.Sizeof(*new(S)) * uintptr(cap(value)))) if n == 0 { n = 1 } // Create a new arena and do a bunch of operations on it. arena := NewUserArena() arenaValues := make([][]S, 0, n) for j := 0; j < n; j++ { var sl []S arena.Slice(&sl, cap(value)) copy(sl, value) arenaValues = append(arenaValues, sl) } // Check integrity of allocated data. for _, sl := range arenaValues { for i := range sl { got := sl[i] want := value[i] if got != want { t.Errorf("failed integrity check: got %#v, want %#v at index %d", got, want, i) } } } // Release the arena. arena.Free() }) } func TestUserArenaLiveness(t *testing.T) { t.Run("Free", func(t *testing.T) { testUserArenaLiveness(t, false) }) t.Run("Finalizer", func(t *testing.T) { testUserArenaLiveness(t, true) }) } func testUserArenaLiveness(t *testing.T, useArenaFinalizer bool) { // Disable the GC so that there's zero chance we try doing anything arena related *during* // a mark phase, since otherwise a bunch of arenas could end up on the fault list. defer debug.SetGCPercent(debug.SetGCPercent(-1)) // Defensively ensure that any full arena chunks leftover from previous tests have been cleared. GC() GC() arena := NewUserArena() // Allocate a few pointer-ful but un-initialized objects so that later we can // place a reference to heap object at a more interesting location. for i := 0; i < 3; i++ { var x any x = (*mediumPointerOdd)(nil) arena.New(&x) } var x any x = (*smallPointerMix)(nil) arena.New(&x) v := x.(*smallPointerMix) var safeToFinalize atomic.Bool var finalized atomic.Bool v.C = new(smallPointer) SetFinalizer(v.C, func(_ *smallPointer) { if !safeToFinalize.Load() { t.Error("finalized arena-referenced object unexpectedly") } finalized.Store(true) }) // Make sure it stays alive. GC() GC() // In order to ensure the object can be freed, we now need to make sure to use // the entire arena. Exhaust the rest of the arena. for i := 0; i < int(UserArenaChunkBytes/unsafe.Sizeof(mediumScalarEven{})); i++ { var x any x = (*mediumScalarEven)(nil) arena.New(&x) } // Make sure it stays alive again. GC() GC() v = nil safeToFinalize.Store(true) if useArenaFinalizer { arena = nil // Try to queue the arena finalizer. GC() GC() // In order for the finalizer we actually want to run to execute, // we need to make sure this one runs first. if !BlockUntilEmptyFinalizerQueue(int64(2 * time.Second)) { t.Fatal("finalizer queue was never emptied") } } else { // Free the arena explicitly. arena.Free() } // Try to queue the object's finalizer that we set earlier. GC() GC() if !BlockUntilEmptyFinalizerQueue(int64(2 * time.Second)) { t.Fatal("finalizer queue was never emptied") } if !finalized.Load() { t.Error("expected arena-referenced object to be finalized") } } func TestUserArenaClearsPointerBits(t *testing.T) { // This is a regression test for a serious issue wherein if pointer bits // aren't properly cleared, it's possible to allocate scalar data down // into a previously pointer-ful area, causing misinterpretation by the GC. // Create a large object, grab a pointer into it, and free it. x := new([8 << 20]byte) xp := uintptr(unsafe.Pointer(&x[124])) var finalized atomic.Bool SetFinalizer(x, func(_ *[8 << 20]byte) { finalized.Store(true) }) // Write three chunks worth of pointer data. Three gives us a // high likelihood that when we write 2 later, we'll get the behavior // we want. a := NewUserArena() for i := 0; i < int(UserArenaChunkBytes/goarch.PtrSize*3); i++ { var x any x = (*smallPointer)(nil) a.New(&x) } a.Free() // Recycle the arena chunks. GC() GC() a = NewUserArena() for i := 0; i < int(UserArenaChunkBytes/goarch.PtrSize*2); i++ { var x any x = (*smallScalar)(nil) a.New(&x) v := x.(*smallScalar) // Write a pointer that should not keep x alive. *v = smallScalar{xp} } KeepAlive(x) x = nil // Try to free x. GC() GC() if !BlockUntilEmptyFinalizerQueue(int64(2 * time.Second)) { t.Fatal("finalizer queue was never emptied") } if !finalized.Load() { t.Fatal("heap allocation kept alive through non-pointer reference") } // Clean up the arena. a.Free() GC() GC() } func TestUserArenaCloneString(t *testing.T) { a := NewUserArena() // A static string (not on heap or arena) var s = "abcdefghij" // Create a byte slice in the arena, initialize it with s var b []byte a.Slice(&b, len(s)) copy(b, s) // Create a string as using the same memory as the byte slice, hence in // the arena. This could be an arena API, but hasn't really been needed // yet. as := unsafe.String(&b[0], len(b)) // Clone should make a copy of as, since it is in the arena. asCopy := UserArenaClone(as) if unsafe.StringData(as) == unsafe.StringData(asCopy) { t.Error("Clone did not make a copy") } // Clone should make a copy of subAs, since subAs is just part of as and so is in the arena. subAs := as[1:3] subAsCopy := UserArenaClone(subAs) if unsafe.StringData(subAs) == unsafe.StringData(subAsCopy) { t.Error("Clone did not make a copy") } if len(subAs) != len(subAsCopy) { t.Errorf("Clone made an incorrect copy (bad length): %d -> %d", len(subAs), len(subAsCopy)) } else { for i := range subAs { if subAs[i] != subAsCopy[i] { t.Errorf("Clone made an incorrect copy (data at index %d): %d -> %d", i, subAs[i], subAs[i]) } } } // Clone should not make a copy of doubleAs, since doubleAs will be on the heap. doubleAs := as + as doubleAsCopy := UserArenaClone(doubleAs) if unsafe.StringData(doubleAs) != unsafe.StringData(doubleAsCopy) { t.Error("Clone should not have made a copy") } // Clone should not make a copy of s, since s is a static string. sCopy := UserArenaClone(s) if unsafe.StringData(s) != unsafe.StringData(sCopy) { t.Error("Clone should not have made a copy") } a.Free() } func TestUserArenaClonePointer(t *testing.T) { a := NewUserArena() // Clone should not make a copy of a heap-allocated smallScalar. x := Escape(new(smallScalar)) xCopy := UserArenaClone(x) if unsafe.Pointer(x) != unsafe.Pointer(xCopy) { t.Errorf("Clone should not have made a copy: %#v -> %#v", x, xCopy) } // Clone should make a copy of an arena-allocated smallScalar. var i any i = (*smallScalar)(nil) a.New(&i) xArena := i.(*smallScalar) xArenaCopy := UserArenaClone(xArena) if unsafe.Pointer(xArena) == unsafe.Pointer(xArenaCopy) { t.Errorf("Clone should have made a copy: %#v -> %#v", xArena, xArenaCopy) } if *xArena != *xArenaCopy { t.Errorf("Clone made an incorrect copy copy: %#v -> %#v", *xArena, *xArenaCopy) } a.Free() } func TestUserArenaCloneSlice(t *testing.T) { a := NewUserArena() // A static string (not on heap or arena) var s = "klmnopqrstuv" // Create a byte slice in the arena, initialize it with s var b []byte a.Slice(&b, len(s)) copy(b, s) // Clone should make a copy of b, since it is in the arena. bCopy := UserArenaClone(b) if unsafe.Pointer(&b[0]) == unsafe.Pointer(&bCopy[0]) { t.Errorf("Clone did not make a copy: %#v -> %#v", b, bCopy) } if len(b) != len(bCopy) { t.Errorf("Clone made an incorrect copy (bad length): %d -> %d", len(b), len(bCopy)) } else { for i := range b { if b[i] != bCopy[i] { t.Errorf("Clone made an incorrect copy (data at index %d): %d -> %d", i, b[i], bCopy[i]) } } } // Clone should make a copy of bSub, since bSub is just part of b and so is in the arena. bSub := b[1:3] bSubCopy := UserArenaClone(bSub) if unsafe.Pointer(&bSub[0]) == unsafe.Pointer(&bSubCopy[0]) { t.Errorf("Clone did not make a copy: %#v -> %#v", bSub, bSubCopy) } if len(bSub) != len(bSubCopy) { t.Errorf("Clone made an incorrect copy (bad length): %d -> %d", len(bSub), len(bSubCopy)) } else { for i := range bSub { if bSub[i] != bSubCopy[i] { t.Errorf("Clone made an incorrect copy (data at index %d): %d -> %d", i, bSub[i], bSubCopy[i]) } } } // Clone should not make a copy of bNotArena, since it will not be in an arena. bNotArena := make([]byte, len(s)) copy(bNotArena, s) bNotArenaCopy := UserArenaClone(bNotArena) if unsafe.Pointer(&bNotArena[0]) != unsafe.Pointer(&bNotArenaCopy[0]) { t.Error("Clone should not have made a copy") } a.Free() } func TestUserArenaClonePanic(t *testing.T) { var s string func() { x := smallScalar{2} defer func() { if v := recover(); v != nil { s = v.(string) } }() UserArenaClone(x) }() if s == "" { t.Errorf("expected panic from Clone") } }