usnic: certain send frag members are immutable
Ensure that they never are touched by checking in their destructors. Reviewed-by: Jeff Squyres <jsquyres@cisco.com> Reviewed-by: Reese Faucette <rfaucett@cisco.com> This commit was SVN r29589.
Этот коммит содержится в:
родитель
a45d5603a3
Коммит
825686a205
@ -172,6 +172,18 @@ send_frag_constructor(ompi_btl_usnic_send_frag_t *frag)
|
||||
frag->sf_seg_post_cnt = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
send_frag_destructor(ompi_btl_usnic_send_frag_t *frag)
|
||||
{
|
||||
mca_btl_base_descriptor_t *desc;
|
||||
|
||||
/* make sure nobody twiddled these values after the constructor */
|
||||
desc = &frag->sf_base.uf_base;
|
||||
assert(desc->des_src == frag->sf_base.uf_src_seg);
|
||||
assert(0 == frag->sf_base.uf_src_seg[0].seg_len);
|
||||
/* PML may change desc->des_dst to point elsewhere, cannot assert that it
|
||||
* still points to our embedded segment */
|
||||
}
|
||||
|
||||
static void
|
||||
small_send_frag_constructor(ompi_btl_usnic_small_send_frag_t *frag)
|
||||
@ -202,6 +214,8 @@ small_send_frag_destructor(ompi_btl_usnic_small_send_frag_t *frag)
|
||||
fseg = &frag->ssf_segment;
|
||||
assert(fseg->ss_parent_frag == (struct ompi_btl_usnic_send_frag_t *)frag);
|
||||
assert(frag->ssf_base.sf_base.uf_type == OMPI_BTL_USNIC_FRAG_SMALL_SEND);
|
||||
assert(frag->ssf_base.sf_base.uf_src_seg[0].seg_addr.pval ==
|
||||
fseg->ss_base.us_payload.raw);
|
||||
OBJ_DESTRUCT(fseg);
|
||||
}
|
||||
|
||||
@ -228,6 +242,13 @@ put_dest_frag_constructor(ompi_btl_usnic_put_dest_frag_t *pfrag)
|
||||
pfrag->uf_base.des_dst_cnt = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
put_dest_frag_destructor(ompi_btl_usnic_put_dest_frag_t *pfrag)
|
||||
{
|
||||
assert(pfrag->uf_base.des_dst == pfrag->uf_dst_seg);
|
||||
assert(1 == pfrag->uf_base.des_dst_cnt);
|
||||
}
|
||||
|
||||
OBJ_CLASS_INSTANCE(ompi_btl_usnic_segment_t,
|
||||
ompi_free_list_item_t,
|
||||
NULL,
|
||||
@ -264,7 +285,7 @@ OBJ_CLASS_INSTANCE(ompi_btl_usnic_frag_t,
|
||||
OBJ_CLASS_INSTANCE(ompi_btl_usnic_send_frag_t,
|
||||
ompi_btl_usnic_frag_t,
|
||||
send_frag_constructor,
|
||||
NULL);
|
||||
send_frag_destructor);
|
||||
|
||||
OBJ_CLASS_INSTANCE(ompi_btl_usnic_large_send_frag_t,
|
||||
ompi_btl_usnic_send_frag_t,
|
||||
@ -279,4 +300,4 @@ OBJ_CLASS_INSTANCE(ompi_btl_usnic_small_send_frag_t,
|
||||
OBJ_CLASS_INSTANCE(ompi_btl_usnic_put_dest_frag_t,
|
||||
ompi_btl_usnic_frag_t,
|
||||
put_dest_frag_constructor,
|
||||
NULL);
|
||||
put_dest_frag_destructor);
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user