zeroshade commented on code in PR #37785: URL: https://github.com/apache/arrow/pull/37785#discussion_r1337357947
########## go/parquet/internal/utils/clib.go: ########## @@ -0,0 +1,30 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !noasm && !appengine && (amd64 || arm64) +// +build !noasm +// +build !appengine +// +build amd64 arm64 + +package utils + +import "unsafe" + +//go:noescape +func _ClibMemcpy(dst, src unsafe.Pointer, n uint) unsafe.Pointer + +//go:noescape +func _ClibMemset(dst unsafe.Pointer, c int, n uint) unsafe.Pointer Review Comment: this exists *purely* to test the assembly versions I provided. The issue is that the C implementation I'm using to generate the assembly makes calls to memset and memcpy, but C's calling conventions are different than Go's. So in the assembly when it calls memset/memcpy I replaced those CALL instructions to call these replacement versions (because I can't call out to libc from inside of Go like that, no guarantee that the lib is loaded). Which are essentially just ported versions of the C memcpy/memset to ensure that the Calling conventions and argument handling are the same. The underscore prefix there ensures that the methods are not exported from the package, so I'm only using these for `clib_test.go` in order to sanity check the assembly methods. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
