mirror of
https://git.telodendria.io/Telodendria/Cytoplasm.git
synced 2025-04-29 04:16:03 +00:00
[FIX/WIP] Temporary fix to the database system
It used to crash, my bad.
This commit is contained in:
parent
2b061f1226
commit
f6af2cd782
2 changed files with 17 additions and 21 deletions
13
src/Db/Db.c
13
src/Db/Db.c
|
@ -434,6 +434,7 @@ DbInit(Db *db)
|
|||
db->mostRecent = NULL;
|
||||
db->leastRecent = NULL;
|
||||
db->cacheSize = 0;
|
||||
db->maxCache = 0;
|
||||
|
||||
if (db->maxCache)
|
||||
{
|
||||
|
@ -460,15 +461,9 @@ DbRefInit(Db *db, DbRef *ref)
|
|||
ref->ts = UtilTsMillis();
|
||||
ref->size = 0;
|
||||
|
||||
if (db->mostRecent)
|
||||
{
|
||||
db->mostRecent->next = ref;
|
||||
}
|
||||
if (!db->leastRecent)
|
||||
{
|
||||
db->leastRecent = ref;
|
||||
}
|
||||
db->mostRecent = ref;
|
||||
/* TODO: Append the ref to the cache list.
|
||||
* I removed it because it broke everything and crashed all the time.
|
||||
* My bad! */
|
||||
}
|
||||
void
|
||||
StringArrayAppend(Array *arr, char *str)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue