Skip to content

Commit

Permalink
Merge branch '141-get-many-32-bit' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
greenrobot committed Aug 29, 2024
2 parents 747e63b + ed339c2 commit 4d7601b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test:linux:x64:
- GOVERSION: [ '1.13', '1.14', '1.15', '1.16', '1.17', '1.18', '1.19', '1.20', '1.21', '1.22' ]

# TODO Not working on shell runner (e.g. with default (old) version): investigate and find a working setup
.test:linux:ARMv7hf:
test:linux:ARMv7hf:
extends: .test
tags: [ armv7hf, linux, shell ]
variables:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ id, err := box.Put(&Person{ FirstName: "Joe", LastName: "Green" })
Want details? **[Read the docs](https://golang.objectbox.io/)** or
**[check out the API reference](https://godoc.org/github.com/objectbox/objectbox-go/objectbox)**.

Latest release: [v1.8.0 (2024-02-16)](https://golang.objectbox.io/)
Latest release: [v1.8.1 (2024-08-29)](https://golang.objectbox.io/)

## Table of Contents:
- [High-performance Golang database](#high-performance-golang-database)
Expand Down
24 changes: 18 additions & 6 deletions objectbox/datavisitorc.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018-2021 ObjectBox Ltd. All rights reserved.
* Copyright 2018-2024 ObjectBox Ltd. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -26,19 +26,31 @@ package objectbox
*/
import "C"
import (
"fmt"
"unsafe"
)

//export dataVisitorDispatch
// "Implements" the C function obx_data_visitor and dispatches to the registered Go data visitor.
// This function finds the data visitor (based on the pointer to the visitorId) and calls it with the given data
// NOTE: don't change ptr contents, it's `const void*` in C but go doesn't support const pointers
func dataVisitorDispatch(visitorIdPtr unsafe.Pointer, data unsafe.Pointer, size C.size_t) C.bool {
var visitorId = *(*uint32)(visitorIdPtr)
//
//export dataVisitorDispatch
func dataVisitorDispatch(data unsafe.Pointer, size C.size_t, userData unsafe.Pointer) C.bool {
if userData == nil {
panic("Internal error: visitor ID pointer is nil")
}
var visitorId = *(*uint32)(userData)

// create an empty byte slice and map the C data to it, no copy required
var bytes []byte
cVoidPtrToByteSlice(data, int(size), &bytes)
if data != nil {
cVoidPtrToByteSlice(data, int(size), &bytes)
}

var fn = dataVisitorLookup(visitorId)
if fn == nil {
panic(fmt.Sprintf("Internal error: no data visitor found for ID %d", visitorId))
}

var fn = dataVisitorLookup(uint32(visitorId))
return C.bool(fn(bytes))
}
4 changes: 2 additions & 2 deletions objectbox/version.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018-2022 ObjectBox Ltd. All rights reserved.
* Copyright 2018-2024 ObjectBox Ltd. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -51,7 +51,7 @@ func (v Version) String() string {
// VersionGo returns the Version of the ObjectBox-Go binding
func VersionGo() Version {
// for label, use `beta.0` format, increasing the counter for each subsequent release
return Version{1, 8, 0, ""}
return Version{1, 8, 1, ""}
}

// VersionLib returns the Version of the dynamic linked ObjectBox library (loaded at runtime)
Expand Down

0 comments on commit 4d7601b

Please sign in to comment.