implemented retain/release semantics for compiled functions