Skip to content

Commit

Permalink
use C.kCFAllocatorDefault instead of refZero
Browse files Browse the repository at this point in the history
  • Loading branch information
nonsense committed Aug 27, 2018
1 parent 4e54e7f commit 73bc5b1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 26 deletions.
6 changes: 3 additions & 3 deletions watcher_fsevents_cgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var wg sync.WaitGroup // used to wait until the runloop starts
// started and is ready via the wg. It also serves purpose of a dummy source,
// thanks to it the runloop does not return as it also has at least one source
// registered.
var source = C.CFRunLoopSourceCreate(refZero, 0, &C.CFRunLoopSourceContext{
var source = C.CFRunLoopSourceCreate(C.kCFAllocatorDefault, 0, &C.CFRunLoopSourceContext{
perform: (C.CFRunLoopPerformCallBack)(C.gosource),
})

Expand Down Expand Up @@ -166,8 +166,8 @@ func (s *stream) Start() error {
return nil
}
wg.Wait()
p := C.CFStringCreateWithCStringNoCopy(refZero, C.CString(s.path), C.kCFStringEncodingUTF8, refZero)
path := C.CFArrayCreate(refZero, (*unsafe.Pointer)(unsafe.Pointer(&p)), 1, nil)
p := C.CFStringCreateWithCStringNoCopy(C.kCFAllocatorDefault, C.CString(s.path), C.kCFStringEncodingUTF8, C.kCFAllocatorDefault)
path := C.CFArrayCreate(C.kCFAllocatorDefault, (*unsafe.Pointer)(unsafe.Pointer(&p)), 1, nil)
ctx := C.FSEventStreamContext{}
ref := C.EventStreamCreate(&ctx, C.uintptr_t(s.info), path, C.FSEventStreamEventId(atomic.LoadUint64(&since)), latency, flags)
if ref == nilstream {
Expand Down
14 changes: 0 additions & 14 deletions watcher_fsevents_go1.10.go

This file was deleted.

9 changes: 0 additions & 9 deletions watcher_fsevents_go1.11.go

This file was deleted.

0 comments on commit 73bc5b1

Please sign in to comment.