miloyip
Repos
29
Followers
10074
Following
32

Events

CMakeLists: fix optflags for ppc

Created at 3 weeks ago
pull request closed
CMakeLists: fix optflags for ppc

Unbreak ppc :)

Created at 3 weeks ago
issue comment
Apple silicon support

snprintf is C++11 so it cannot pass CI.

Created at 3 weeks ago
issue comment
关于Tutorial04中将Unicode字符转换为UTF-8存储的lept_encode_utf8的写法

避免 malloc()/free(),这里似乎用 PUTC() 就 OK。 如果真想写成数组,声明为 char ch[2],然后宏里面也可以用 sizeof(ch)== 2)。

Created at 1 month ago

Use passed in allocator.

Created at 2 months ago
pull request closed
Use passed in allocator.

The Schema class here allows a user to provide a custom allocator which I believe should be used here instead of the default CrtAllocator. This would be kind of problematic in cases like a client provides an allocator that throws on memory allocation error since the default CrtAllocator does not throw.

Created at 2 months ago
issue comment
Is there a way to convert Object to std::string?

Rather:

std::string stringify(const rapidjson::Value& v)
{
	if (v.IsString())
		return { v.GetString(), v.GetStringLength() };
	else
	{
		rapidjson::StringBuffer strbuf;
		rapidjson::Writer<rapidjson::StringBuffer> writer(strbuf);
		v.Accept(writer);
		return { strbuf.GetString(), strbuf.GetLength() };
	}
}

Faster and will also prevent quotes around from being added if the value is already a string.

JSON and JSON string value are two different concepts. Just returning the string value is not "stringifying a JSON".

Created at 2 months ago

fix #1

Suppress uritest

Created at 2 months ago
pull request closed
Fix the address sanitizer problems - part 1

This PR is intended to address the SIMD unit test sanitizer problem identified in issue #2019, and any other sanitizer problems that are being thrown up when running other RapidJSON unit tests under valgrind . #2019 contains the list but in summary:

  1. SIMD.SkipWhitespace
  • Invalid read of size 16 (the original subject of issue #2019)
  • Conditional jump or move depends on uninitialised value(s)
  • Use of uninitialised value of size 8
  1. Uri.Parse_UTF16 with std::string
  • Invalid read of size 32

I am seeing all these on master branch (Fedora 36).

Created at 2 months ago
issue comment
Fix the address sanitizer problems

I am unsure about the suppression situation. Adding alignment to input buffer in this PR should help. But not sure if it can fix all valgrind problems. If this PR can improve some situations that you encountered, I think we may merge it first.

Created at 2 months ago

fix a typo in error.h: literial -> literal

Created at 2 months ago
pull request closed
fix a typo in error.h: literial -> literal

#2109 In /include/rapidjson/error/error.h A small typo: literial -> literal

Created at 2 months ago