Pack the buffer object from the beginning
This commit was SVN r27592.
Этот коммит содержится в:
родитель
b3c0ad9c56
Коммит
b9609203b7
@ -632,19 +632,17 @@ int opal_dss_pack_buffer_contents(opal_buffer_t *buffer, const void *src,
|
|||||||
opal_buffer_t **ptr;
|
opal_buffer_t **ptr;
|
||||||
int32_t i;
|
int32_t i;
|
||||||
int ret;
|
int ret;
|
||||||
size_t offset, bytes_to_pack;
|
|
||||||
|
|
||||||
ptr = (opal_buffer_t **) src;
|
ptr = (opal_buffer_t **) src;
|
||||||
|
|
||||||
for (i = 0; i < num_vals; ++i) {
|
for (i = 0; i < num_vals; ++i) {
|
||||||
/* pack the number of bytes */
|
/* pack the number of bytes */
|
||||||
offset = ((char*)ptr[i]->unpack_ptr) - ((char*)ptr[i]->base_ptr);
|
OPAL_OUTPUT((opal_dss_verbose, "opal_dss_pack_buffer_contents: bytes_used %u\n", (unsigned)ptr[i]->bytes_used));
|
||||||
bytes_to_pack = ptr[i]->bytes_used - offset;
|
if (OPAL_SUCCESS != (ret = opal_dss_pack_sizet(buffer, &ptr[i]->bytes_used, 1, OPAL_SIZE))) {
|
||||||
if (OPAL_SUCCESS != (ret = opal_dss_pack_sizet(buffer, &bytes_to_pack, 1, OPAL_SIZE))) {
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
/* pack the bytes */
|
/* pack the bytes */
|
||||||
if (OPAL_SUCCESS != (ret = opal_dss_pack_byte(buffer, ptr[i]->unpack_ptr, bytes_to_pack, OPAL_BYTE))) {
|
if (OPAL_SUCCESS != (ret = opal_dss_pack_byte(buffer, ptr[i]->base_ptr, ptr[i]->bytes_used, OPAL_BYTE))) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user