Issues with memref operations

side note: please don’t, we are (ab)using ‘allocated’ pointer to store control block pointer for reference-counted merefs :slight_smile: