summaryrefslogtreecommitdiff
path: root/libgo/runtime/go-rec-nb-big.c
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2011-05-20 00:18:15 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2011-05-20 00:18:15 +0000
commit84911de8492fb75007eec6bfa4abb7905439f93c (patch)
treec891bdec1e6f073f73fedeef23718bc3ac30d499 /libgo/runtime/go-rec-nb-big.c
parentad33e6a8510b48571eaef50af339892925108830 (diff)
downloadgcc-84911de8492fb75007eec6bfa4abb7905439f93c.tar.gz
Update to current version of Go library.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@173931 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/runtime/go-rec-nb-big.c')
-rw-r--r--libgo/runtime/go-rec-nb-big.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libgo/runtime/go-rec-nb-big.c b/libgo/runtime/go-rec-nb-big.c
index 78db587345f..8c315b19af7 100644
--- a/libgo/runtime/go-rec-nb-big.c
+++ b/libgo/runtime/go-rec-nb-big.c
@@ -14,23 +14,24 @@ _Bool
__go_receive_nonblocking_big (struct __go_channel* channel, void *val,
_Bool *closed)
{
+ uintptr_t element_size;
size_t alloc_size;
size_t offset;
- alloc_size = ((channel->element_size + sizeof (uint64_t) - 1)
- / sizeof (uint64_t));
+ element_size = channel->element_type->__size;
+ alloc_size = (element_size + sizeof (uint64_t) - 1) / sizeof (uint64_t);
int data = __go_receive_nonblocking_acquire (channel);
if (data != RECEIVE_NONBLOCKING_ACQUIRE_DATA)
{
- __builtin_memset (val, 0, channel->element_size);
+ __builtin_memset (val, 0, element_size);
if (closed != NULL)
*closed = data == RECEIVE_NONBLOCKING_ACQUIRE_CLOSED;
return 0;
}
offset = channel->next_fetch * alloc_size;
- __builtin_memcpy (val, &channel->data[offset], channel->element_size);
+ __builtin_memcpy (val, &channel->data[offset], element_size);
__go_receive_release (channel);