Merge pull request #34 from aeternity/uw-batch-release

Don't try to release dummy batch ref
This commit is contained in:
Ulf Wiger 2022-10-31 17:01:15 +01:00 committed by GitHub
commit 4489e5d743
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -800,7 +800,7 @@ handle_call({create_table, Tab, Props}, _From,
exit:{aborted, Error} -> exit:{aborted, Error} ->
{reply, {aborted, Error}, St} {reply, {aborted, Error}, St}
end; end;
handle_call({load_table, _LoadReason, Props}, {Pid,_}, handle_call({load_table, _LoadReason, Props}, _,
#st{alias = Alias, tab = Tab} = St) -> #st{alias = Alias, tab = Tab} = St) ->
{ok, _Ref} = mnesia_rocksdb_admin:load_table(Alias, Tab, Props), {ok, _Ref} = mnesia_rocksdb_admin:load_table(Alias, Tab, Props),
{reply, ok, St#st{status = active}}; {reply, ok, St#st{status = active}};
@ -828,7 +828,7 @@ handle_call({delete, Key}, _From, St) ->
handle_call({match_delete, Pat}, _From, #st{tab = Tab} = St) -> handle_call({match_delete, Pat}, _From, #st{tab = Tab} = St) ->
Res = mrdb:match_delete(get_ref(Tab), Pat), Res = mrdb:match_delete(get_ref(Tab), Pat),
{reply, Res, St}; {reply, Res, St};
handle_call(close_table, {Pid,_}, #st{alias = Alias, tab = Tab} = St) -> handle_call(close_table, _, #st{alias = Alias, tab = Tab} = St) ->
_ = mnesia_rocksdb_admin:close_table(Alias, Tab), _ = mnesia_rocksdb_admin:close_table(Alias, Tab),
{reply, ok, St#st{status = undefined}}; {reply, ok, St#st{status = undefined}};
handle_call(delete_table, _From, #st{alias = Alias, tab = Tab} = St) -> handle_call(delete_table, _From, #st{alias = Alias, tab = Tab} = St) ->

View File

@ -506,6 +506,8 @@ rdb_write_batch_and_pop(BatchRef, C) ->
pop_ctxt() pop_ctxt()
end. end.
rdb_release_batch(?BATCH_REF_DUMMY) ->
ok;
rdb_release_batch(H) -> rdb_release_batch(H) ->
rocksdb:release_batch(H). rocksdb:release_batch(H).