Commit graph

14 commits

Author SHA1 Message Date
789baf33a1 Make Db interfaces take varargs.
This makes it much more flexible, at the expense of making it a little
more fragile. I can think of a number of scenarios where we'll have
paths that have variables in multiple spots, and I don't want to do
sprintf() magic every time I need to access an object at one of those
paths.
2022-11-21 20:31:37 +00:00
0c6c1e5b19 Notify the user about the minimum max-cache instead of silently setting it. 2022-11-21 16:22:50 +00:00
cd584c1e93 Lock objects on disk if they're locked in memory.
This requires hanging onto an open file handle, and doesn't require
explicit unlocking, because POSIX says files are unlocked when their
descriptors are closed.
2022-11-21 16:13:11 +00:00
07f4ecd2d7 Make a number of improvements to cache handling.
- Items that are too big for the cache are now no longer immediately
  evicted; everything else is. This is probably not desirable, but it is
  not unexpected.
- Multithreading now should work as expected; DbRefs are locked before
  they are updated from the disk, and they are not evicted from the cache
  if they are locked by another thread.
- The cache may be no smaller than 1024 bytes. Previously the caller of
  DbOpen() could choose to disable the cache, and provisions were made in
  the code to support this, but this is now no longer possible because
  without the cache, there would be no way to know what files were open,
  which could lead to a race condition if two threads open the same file.
2022-11-18 22:17:56 +00:00
045c6d8644 Cache eviction 2022-11-18 20:42:08 +00:00
e7ad166877 Fix some memory leaks in Db 2022-11-18 19:36:15 +00:00
2e6c129263 Fix a mutex bug in Db and some memory errors in Json 2022-11-17 23:51:45 +00:00
d26fad4619 Add UtilMkdir() to recursively make directories 2022-11-17 22:57:29 +00:00
46cc1df385 Do some Db work 2022-11-15 18:20:05 +00:00
a356403cfd Finish DbComputeSize() 2022-11-12 18:26:31 +00:00
efbbf42a6e Fix memory and connection closing errors. 2022-11-08 01:05:28 +00:00
37ee7700f4 Start writing a function to compute the in-memory size of an object. 2022-11-06 00:47:17 +00:00
fd50fd83fb Misc changes throughout the codebase during testing. 2022-10-31 08:12:42 -04:00
e009536065 Begin prototyping persistent storage API 2022-10-24 12:44:29 -04:00