From 218ab32666709e0740e25720264a3350cd4a5342 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Mon, 7 Feb 2022 03:38:22 +0000 Subject: [PATCH] more tdb --- source/libs/tdb/src/db/pgcache.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/source/libs/tdb/src/db/pgcache.c b/source/libs/tdb/src/db/pgcache.c index 25ce90e772..5ca65e366e 100644 --- a/source/libs/tdb/src/db/pgcache.c +++ b/source/libs/tdb/src/db/pgcache.c @@ -12,7 +12,6 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ - #include "tdbInt.h" struct SPage { @@ -37,12 +36,22 @@ struct SPgCache { }; int pgCacheCreate(SPgCache **ppPgCache) { - // TODO + SPgCache *pPgCache; + + pPgCache = (SPgCache *)calloc(1, sizeof(*pPgCache)); + if (pPgCache == NULL) { + return -1; + } + + *ppPgCache = pPgCache; return 0; } int pgCacheDestroy(SPgCache *pPgCache) { - // TODO + if (pPgCache) { + free(pPgCache); + } + return 0; } -- GitLab