Fixed allocation of mobile channel bundles, as apparently a clone is unnecessary

This commit is contained in:
Neil Brown 2009-03-24 23:54:13 +00:00
parent 5ffea3f78e
commit eaa8ece954

View File

@ -1728,7 +1728,12 @@ cgenAssign m [vA, vB] (A.AllocChannelBundle _ n)
call genVariable' vA A.Original (const $ Pointer $ Plain "mt_cb_t") call genVariable' vA A.Original (const $ Pointer $ Plain "mt_cb_t")
tell ["=MTAllocChanType(wptr,", show (length fs), ",", tell ["=MTAllocChanType(wptr,", show (length fs), ",",
if shA == A.Shared || shB == A.Shared then "true" else "false", ");"] if shA == A.Shared || shB == A.Shared then "true" else "false", ");"]
call genAssign m [vB] (el $ A.CloneMobile m $ A.ExprVariable m vA) -- Mobile channel types start with a reference count of 2, so no need
-- to clone, just assign:
call genVariable' vB A.Original (const $ Pointer $ Plain "mt_cb_t")
tell ["="]
call genVariable' vA A.Original (const $ Pointer $ Plain "mt_cb_t")
tell [";"]
where where
el e = A.ExpressionList m [e] el e = A.ExpressionList m [e]
cgenAssign m _ _ = call genMissing "Cannot perform assignment with multiple destinations or multiple sources" cgenAssign m _ _ = call genMissing "Cannot perform assignment with multiple destinations or multiple sources"