diff options
author | vvvv <vvvv@yandex-team.ru> | 2022-03-14 21:16:14 +0300 |
---|---|---|
committer | vvvv <vvvv@yandex-team.ru> | 2022-03-14 21:16:14 +0300 |
commit | 21c4ecb814db56677ab9527158be0fe28efb0e4a (patch) | |
tree | 83fe22cca5054d464974da46762d52550f3a7455 | |
parent | 7d1726513f5739feba5df92ff6c92d0327bc14ea (diff) | |
download | ydb-21c4ecb814db56677ab9527158be0fe28efb0e4a.tar.gz |
YQL-13710 initialize resource ownership infrastructure
ref:079623ee34442843f58a85354eaeb50f226efea2
-rw-r--r-- | ydb/library/yql/parser/pg_wrapper/parser.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ydb/library/yql/parser/pg_wrapper/parser.cpp b/ydb/library/yql/parser/pg_wrapper/parser.cpp index 7fc28d209d..56d888e98b 100644 --- a/ydb/library/yql/parser/pg_wrapper/parser.cpp +++ b/ydb/library/yql/parser/pg_wrapper/parser.cpp @@ -23,6 +23,7 @@ extern "C" { #include "utils/palloc.h" #include "utils/memutils.h" #include "utils/memdebug.h" +#include "utils/resowner.h" #include "port/pg_bitutils.h" #include "port/pg_crc32c.h" #include "thread_inits.h" @@ -295,8 +296,15 @@ extern "C" void setup_pg_thread_cleanup() { struct TThreadCleanup { ~TThreadCleanup() { destroy_timezone_hashtable(); + ResourceOwnerDelete(CurrentResourceOwner); + MemoryContextDelete(TopMemoryContext); } }; static thread_local TThreadCleanup ThreadCleanup; + MemoryContextInit(); + auto owner = ResourceOwnerCreate(NULL, "TopTransaction"); + TopTransactionResourceOwner = owner; + CurTransactionResourceOwner = owner; + CurrentResourceOwner = owner; }; |