summaryrefslogtreecommitdiffstats
path: root/tcg
diff options
context:
space:
mode:
authorMarkus Armbruster2015-11-25 22:23:33 +0100
committerMarkus Armbruster2015-11-26 10:07:07 +0100
commitdf649835fe48f635a93316fdefe96ced7189316e (patch)
tree5460f95750d89543d73be1b7c125260f1d8e9f47 /tcg
parentqjson: surprise, allocating 6 QObjects per token is expensive (diff)
downloadqemu-df649835fe48f635a93316fdefe96ced7189316e.tar.gz
qemu-df649835fe48f635a93316fdefe96ced7189316e.tar.xz
qemu-df649835fe48f635a93316fdefe96ced7189316e.zip
qjson: Limit number of tokens in addition to total size
Commit 29c75dd "json-streamer: limit the maximum recursion depth and maximum token count" attempts to guard against excessive heap usage by limiting total token size (it says "token count", but that's a lie). Total token size is a rather imprecise predictor of heap usage: many small tokens use more space than few large tokens with the same input size, because there's a constant per-token overhead: 37 bytes on my system. Tighten this up: limit the token count to 2Mi. Chosen to roughly match the 64MiB total token size limit. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1448486613-17634-13-git-send-email-armbru@redhat.com>
Diffstat (limited to 'tcg')
0 files changed, 0 insertions, 0 deletions