Skip to content

Commit a58251e

Browse files
committed
update docs
1 parent a8b0ab8 commit a58251e

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

Json.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ typedef struct JsonObjectMember JsonObjectMember;
8585

8686
struct Json
8787
{
88-
JsonType type; // Type of value: number, boolean, string, array, object
88+
JsonType type; // Type of value: number, boolean, string, array, object
89+
// int32_t next : 24; // Next item in array, object
8990
int32_t length; // Length of value, always 1 on primitive types, UTF8 string length
9091
union
9192
{
@@ -106,6 +107,12 @@ struct JsonObjectMember
106107
Json value;
107108
};
108109

110+
#if 0
111+
#include <assert.h>
112+
static_assert(sizeof(Json) == 16, "");
113+
static_assert(alignof(Json) == 16, "");
114+
#endif
115+
109116
// -------------------------------------------------------------------
110117
// Constants
111118
// -------------------------------------------------------------------

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ After sometimes use this, I found that API have flaws of its own:
4646
- Continue to the above, reorder should help? Not exactly, how to reorder, how much reorder overhead, that too much works for simple parsing simple data format like JSON.
4747
- No big projects usage.
4848
- Parsing still too complex
49-
-> Decisioning to exploring some best practices from other parser, [MetaDesk](https://github.com/ryanfleury/metadesk) is good example. Linked list in one single arena of memory is good enough.
49+
> _*Conclusion*_:
50+
> - Decisioning to exploring some best practices from other parser, [MetaDesk](https://github.com/ryanfleury/metadesk) is good example. Linked list in one single arena of memory is good enough.
51+
> - For production code, we should use battle-tested library. Mai suggestion is [yyjson](https://github.com/ibireme/yyjson)
52+
> - Start new project call sjson (Simplified Json, but also mean Simplified Json Parser, more simple implementation)
5053
5154

5255
## Examples

0 commit comments

Comments
 (0)