aboutsummaryrefslogtreecommitdiff
path: root/tests/libsqfs/table.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2022-12-04 01:33:45 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-01-19 16:24:56 +0100
commit47f24f2a8faf71395a1d054e9823beb000442cce (patch)
treedd01d8b69125b3dda444c9b92437ad0c5a0af9bc /tests/libsqfs/table.c
parent4160b50a0b4c51f8b7191928cdf38d9fb0147fe2 (diff)
Implement rudimentary reference counting for sqfs_object_t
Implement grab/drop functions to increase/decrease reference count and destroy the object if the count drops to 0. Make sure that all objects that maintain internal references actually grab that reference, duplicate it in the copy function, drop it in the destroy handler. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'tests/libsqfs/table.c')
-rw-r--r--tests/libsqfs/table.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/libsqfs/table.c b/tests/libsqfs/table.c
index ed373a7..3e44fa3 100644
--- a/tests/libsqfs/table.c
+++ b/tests/libsqfs/table.c
@@ -84,7 +84,7 @@ static sqfs_s32 dummy_uncompress(sqfs_compressor_t *cmp, const sqfs_u8 *in,
}
static sqfs_file_t dummy_file = {
- { NULL, NULL },
+ { 1, NULL, NULL },
dummy_read_at,
dummy_write_at,
dummy_get_size,
@@ -92,7 +92,7 @@ static sqfs_file_t dummy_file = {
};
static sqfs_compressor_t dummy_compressor = {
- { NULL, NULL },
+ { 1, NULL, NULL },
NULL,
NULL,
NULL,
@@ -100,7 +100,7 @@ static sqfs_compressor_t dummy_compressor = {
};
static sqfs_compressor_t dummy_uncompressor = {
- { NULL, NULL },
+ { 1, NULL, NULL },
NULL,
NULL,
NULL,