Ensure that a StreamNode is always owned by only one StreamBitmap
In this commit, we change the ownership of a StreamNode, so that when a
StreamNode A is added as an input to a StreamNode B, the bitmap that was
pointing to A abandons the ownership and the pointer is set to NULL. In the
above example, when GPDB frees BitmapOR, it will not attempt to free OR's
StreamNode.
In addition, if a StreamNode is an OpStream, then opstream_free function is
used to free the memory used by the StreamNode, which actually uses pfree. On
the other hand, if a StreamNode is an IndexStream, then stream_free function is
invoked, which does not pfree the StreamNode. For consistency, we add function
indexstream_free to always pfree a StreamNode of IndexStream type.
Signed-off-by: NShreedhar Hardikar <shardikar@pivotal.io>
Showing
想要评论请 注册 或 登录