New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added serialization of the trie into a memory buffer. #12
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Symbols in libdatrie.map
are versioned. Instead of inserting new symbols to old version block, please create a new version block (DATRIE_0.2.13
), deriving from DATRIE_0.2.7
, and add new symbols there. For libdatrie.def
, simple insertion is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.