1
2
3
4
5
6
7 package cgotest
8
9
13 import "C"
14 import (
15 "runtime/debug"
16 "testing"
17 "unsafe"
18 )
19
20 func test21897(t *testing.T) {
21
22 defer debug.SetGCPercent(debug.SetGCPercent(1))
23
24 for i := 0; i < 10000; i++ {
25 testCFNumberRef()
26 testCFDateRef()
27 testCFBooleanRef()
28
29
30 byteSliceSink = make([]byte, 1024)
31 }
32 }
33
34 var byteSliceSink []byte
35
36 func testCFNumberRef() {
37 var v int64 = 0
38 xCFNumberRef = C.CFNumberCreate(C.kCFAllocatorSystemDefault, C.kCFNumberSInt64Type, unsafe.Pointer(&v))
39
40 }
41
42 var xCFNumberRef C.CFNumberRef
43
44 func testCFDateRef() {
45 xCFDateRef = C.CFDateCreate(C.kCFAllocatorSystemDefault, 0)
46
47 }
48
49 var xCFDateRef C.CFDateRef
50
51 func testCFBooleanRef() {
52 xCFBooleanRef = C.kCFBooleanFalse
53
54 }
55
56 var xCFBooleanRef C.CFBooleanRef
57
View as plain text