Added serialization of the trie into a memory buffer.#12
Conversation
thep
left a comment
There was a problem hiding this comment.
I'd prefer function naming to start with target object type, so they look like OOP object methods. Please rename get_trie_serialized_size(). get_alpha_map_serialized_size(), get_tail_serialized_size() to trie_get_serialized_size(), alpha_map_get_serialized_size(), tail_get_serialized_size() respectively.
With this, please also update documentation for trie_get_serialized_size(), as it's not for file creation.
3c8d12f to
4d01b86
Compare
|
Sorry for some comments that might introduce some confusion. In low-level code like serialization, I think we need to be strict on bytes and use |
|
Yeah, we can do so to the whole project once we decide to move to C99. However, this reminds me of the similar typedefs in |
bf760ef to
fa19e1a
Compare
|
Please also add this change set to diff --git a/tests/Makefile.am b/tests/Makefile.am
index 1c32dc2..41b55cb 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -7,6 +7,7 @@ TESTS = \
test_iterator \
test_store-retrieve \
test_file \
+ test_serialization \
test_nonalpha \
test_null_trie \
test_term_state \
@@ -19,6 +20,7 @@ check_PROGRAMS = \
test_iterator \
test_store-retrieve \
test_file \
+ test_serialization \
test_nonalpha \
test_null_trie \
test_term_state \
@@ -54,6 +56,12 @@ test_file_SOURCES = \
$(NULL)
test_file_LDADD = $(top_builddir)/datrie/libdatrie.la
+test_serialization_SOURCES = \
+ test_serialization.c \
+ utils.c \
+ $(NULL)
+test_serialization_LDADD = $(top_builddir)/datrie/libdatrie.la
+
test_nonalpha_SOURCES = \
test_nonalpha.c \
utils.c \ |
Co-Authored-By: Theppitak Karoonboonyanan <theppitak@gmail.com>
|
Merged. Thank you very much for your contribution! |
|
And thank you for the reviews. |
No description provided.