AmendHub

jcs

/

subtext

/

amendments

/

bile.c

Amendments on September 20, 2023

bile: Sync with upstream

jcs made amendment 524 7 months ago

Amendments on April 18, 2023

bile: Only do synchronous PBFlushFile calls, fixes possible lockup

From Amend
jcs made amendment 482 about 1 year ago

Amendments on March 15, 2023

bile: Reject objects with id 0 in bile_write

This usually indicates some error on the caller's part
jcs made amendment 416 about 1 year ago

Amendments on March 3, 2023

bile: Fix bile_next_id in the case of no highest ID record

jcs made amendment 353 about 1 year ago

Amendments on March 2, 2023


Amendments on March 1, 2023

bile: Add bile_ids_by_type, make bile_sorted_ids_by_type use it

Sometimes there's no point in sorting the results
jcs made amendment 327 about 1 year ago

Amendments on February 24, 2023

bile: Add bile_resize, don't zero in bile_read_alloc

We're going to fill up the buffer we just malloced with existing
data, no need to zero it before hand.
jcs made amendment 320 about 1 year ago

Amendments on February 23, 2023

bile: Make bile_write_map public

jcs made amendment 316 about 1 year ago

Amendments on February 16, 2023

bile: Add flags arg to bile_delete, make zeroing and purging optional

When deleting a bunch of records in a row, we can avoid writing out
a new map every time.
jcs made amendment 301 about 1 year ago

Amendments on February 5, 2023

*: Minor fixes found by cppcheck and scan-build

Mostly unused variables
jcs made amendment 300 about 1 year ago

Amendments on November 29, 2022

bile: Fix file closing in bile_open error path

The bile object may not have been created yet, so don't dereference
it, and its refnum may not be set either so FSClose(fh) instead.
jcs made amendment 292 about 1 year ago

Amendments on August 3, 2022

bile: Better malloc notes

jcs made amendment 228 about 1 year ago

Amendments on July 31, 2022

bile: Pass object size to bile_unmarshall_object to check for overflow

Also add malloc annotations
jcs made amendment 225 about 1 year ago

Amendments on July 21, 2022

*: Use NewPtr instead of malloc, add malloc and free debugging

Instead of free(ptr), use xfree(&ptr) and after it calls
DisposePtr(ptr), it will update ptr to point at NULL to catch
use-after-frees.
When MALLOC_DEBUG is defined, each allocation is added to a
list, and removed when freed. If it's not in the list at free
time, it's a double-free. Also, instead of pointing pointers at
NULL, point them to a pre-defined block of zeroes and in the
idle loop, periodically check that this block is still zero. This
will also catch use-after-frees in a more reliable (but costly)
way.
jcs made amendment 220 about 1 year ago

Amendments on July 19, 2022

bile: Fix unmarshalling of a dynamic field with zero length

Don't xmalloc(0), just set it to a NULL pointer.
jcs made amendment 217 about 1 year ago

Amendments on July 15, 2022

bile: Fix bogus free in bile_sorted_ids_by_type

ids was not being initialized to NULL, so when passed to EXPAND_TO_FIT,
realloc is doing a free of some junk pointer before malloc'ing a new
one.
jcs made amendment 205 about 1 year ago

Amendments on July 12, 2022


Amendments on July 7, 2022


Amendments on June 11, 2022

bile: Bug fixes, store highest ids when deleting

The previous fix was bogus, back it out.
The "o = &bile->map[n - 1]" line seems to have been erroneously copied
and pasted (many times) from another loop where I was going
backwards :(
Implement storage of highest ids seen when deleting, so that
bile_next_id hands out 1 higher than that id. This way we won't
re-use ids of deleted things like users, posts, etc.
jcs made amendment 134 about 1 year ago

Amendments on June 9, 2022

bile: Turn async back on for bile_flush

jcs made amendment 128 about 1 year ago