You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think int is correct here. As mentioned in an afterthought comment, Go int and C size_t are likely to be the same size (not in NaCl, and certainly not guaranteed). I don't think we can guarantee that we are going to do the correct thing. We can however guarantee that we won't do the wrong thing. Because of the fact that we are depending on CGO, we know that we won't be running on NaCl, but we can also have an init function that ensures that unsafe.Sizeof(int(0)) == C.sizeof(size_t) and panics otherwise. There are probably other sanity checks that would be worth considering here too.
details:
In
C
,H5Tset_size
takes asize_t
as argument to set the total size of theDataType
.This was translated into
DataType.SetSize(sz uint)
.This wasn't taking into account the special value
-1
that is used to make aDataType
of variable size.we could settle for Go's
int
but that would be wrong for 32b platforms.perhaps use an explicit
int64
?The text was updated successfully, but these errors were encountered: