{"action":"created","comment":{"url":"https://api.github.com/repos/Samsung/jerryscript/pulls/comments/55816065","id":55816065,"diff_hunk":"@@ -2023,42 +2019,19 @@ jerry_parse_and_save_snapshot (const jerry_api_char_t *source_p, /**< script sou\n   jsp_status_t parse_status;\n   ecma_compiled_code_t *bytecode_data_p;\n \n-  snapshot_buffer_write_offset = 0;\n-  snapshot_last_compiled_code_offset = 0;\n+  snapshot_buffer_write_offset = JERRY_ALIGNUP (sizeof (jerry_snapshot_header_t),\n+                                                MEM_ALIGNMENT);\n   snapshot_error_occured = false;\n   snapshot_buffer_p = buffer_p;\n   snapshot_buffer_size = buffer_size;\n-  snapshot_map_entries_p = NULL;\n-\n-  uint64_t version = JERRY_SNAPSHOT_VERSION;\n-  if (!jrt_write_to_buffer_by_offset (buffer_p,\n-                                      buffer_size,\n-                                      &snapshot_buffer_write_offset,\n-                                      &version,\n-                                      sizeof (version)))\n-  {\n-    return 0;\n-  }\n-\n-  snapshot_buffer_write_offset = JERRY_ALIGNUP (snapshot_buffer_write_offset, MEM_ALIGNMENT);\n-\n-  size_t header_offset = snapshot_buffer_write_offset;\n-\n-  snapshot_buffer_write_offset += JERRY_ALIGNUP (sizeof (jerry_snapshot_header_t), MEM_ALIGNMENT);\n-\n-  if (snapshot_buffer_write_offset > buffer_size)\n-  {\n-    return 0;\n-  }\n-\n-  size_t compiled_code_start = snapshot_buffer_write_offset;\n-\n-  snapshot_report_byte_code_compilation = true;\n   jerry_api_object_t *error_obj_p = NULL;\n \n   if (is_for_global)\n   {\n-    parse_status = parser_parse_script (source_p, source_size, &bytecode_data_p, &error_obj_p);\n+    parse_status = parser_parse_script (source_p,\n+                                        source_size,\n+                                        &bytecode_data_p,\n+                                        &error_obj_p);","path":"jerry-core/jerry.c","position":322,"original_position":322,"commit_id":"66bba0b89a79a536507edd802f94af3fdb2acbbc","original_commit_id":"66bba0b89a79a536507edd802f94af3fdb2acbbc","user":{"login":"zherczeg","id":2270193,"avatar_url":"https://avatars.githubusercontent.com/u/2270193?v=3","gravatar_id":"","url":"https://api.github.com/users/zherczeg","html_url":"https://github.com/zherczeg","followers_url":"https://api.github.com/users/zherczeg/followers","following_url":"https://api.github.com/users/zherczeg/following{/other_user}","gists_url":"https://api.github.com/users/zherczeg/gists{/gist_id}","starred_url":"https://api.github.com/users/zherczeg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zherczeg/subscriptions","organizations_url":"https://api.github.com/users/zherczeg/orgs","repos_url":"https://api.github.com/users/zherczeg/repos","events_url":"https://api.github.com/users/zherczeg/events{/privacy}","received_events_url":"https://api.github.com/users/zherczeg/received_events","type":"User","site_admin":false},"body":"Because parser_parse_eval below uses this style, and for me this looked ugly.","created_at":"2016-03-11T10:55:43Z","updated_at":"2016-03-11T10:55:43Z","html_url":"https://github.com/Samsung/jerryscript/pull/948#discussion_r55816065","pull_request_url":"https://api.github.com/repos/Samsung/jerryscript/pulls/948","_links":{"self":{"href":"https://api.github.com/repos/Samsung/jerryscript/pulls/comments/55816065"},"html":{"href":"https://github.com/Samsung/jerryscript/pull/948#discussion_r55816065"},"pull_request":{"href":"https://api.github.com/repos/Samsung/jerryscript/pulls/948"}}},"pull_request":{"url":"https://api.github.com/repos/Samsung/jerryscript/pulls/948","id":62233524,"html_url":"https://github.com/Samsung/jerryscript/pull/948","diff_url":"https://github.com/Samsung/jerryscript/pull/948.diff","patch_url":"https://github.com/Samsung/jerryscript/pull/948.patch","issue_url":"https://api.github.com/repos/Samsung/jerryscript/issues/948","number":948,"state":"open","locked":false,"title":"Storing byte code size in the byte code header.","user":{"login":"zherczeg","id":2270193,"avatar_url":"https://avatars.githubusercontent.com/u/2270193?v=3","gravatar_id":"","url":"https://api.github.com/users/zherczeg","html_url":"https://github.com/zherczeg","followers_url":"https://api.github.com/users/zherczeg/followers","following_url":"https://api.github.com/users/zherczeg/following{/other_user}","gists_url":"https://api.github.com/users/zherczeg/gists{/gist_id}","starred_url":"https://api.github.com/users/zherczeg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zherczeg/subscriptions","organizations_url":"https://api.github.com/users/zherczeg/orgs","repos_url":"https://api.github.com/users/zherczeg/repos","events_url":"https://api.github.com/users/zherczeg/events{/privacy}","received_events_url":"https://api.github.com/users/zherczeg/received_events","type":"User","site_admin":false},"body":"This reduces the memory consumption, because the new allocator uses less memory if\r\nthe size as available when a block is freed. Snapshot generation is also simplified.","created_at":"2016-03-09T14:11:18Z","updated_at":"2016-03-11T10:55:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5e905891f2f3f9982ef95e3b99663d80f83fd354","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Samsung/jerryscript/pulls/948/commits","review_comments_url":"https://api.github.com/repos/Samsung/jerryscript/pulls/948/comments","review_comment_url":"https://api.github.com/repos/Samsung/jerryscript/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Samsung/jerryscript/issues/948/comments","statuses_url":"https://api.github.com/repos/Samsung/jerryscript/statuses/66bba0b89a79a536507edd802f94af3fdb2acbbc","head":{"label":"zherczeg:byte_code_size","ref":"byte_code_size","sha":"66bba0b89a79a536507edd802f94af3fdb2acbbc","user":{"login":"zherczeg","id":2270193,"avatar_url":"https://avatars.githubusercontent.com/u/2270193?v=3","gravatar_id":"","url":"https://api.github.com/users/zherczeg","html_url":"https://github.com/zherczeg","followers_url":"https://api.github.com/users/zherczeg/followers","following_url":"https://api.github.com/users/zherczeg/following{/other_user}","gists_url":"https://api.github.com/users/zherczeg/gists{/gist_id}","starred_url":"https://api.github.com/users/zherczeg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zherczeg/subscriptions","organizations_url":"https://api.github.com/users/zherczeg/orgs","repos_url":"https://api.github.com/users/zherczeg/repos","events_url":"https://api.github.com/users/zherczeg/events{/privacy}","received_events_url":"https://api.github.com/users/zherczeg/received_events","type":"User","site_admin":false},"repo":{"id":52445090,"name":"jerryscript","full_name":"zherczeg/jerryscript","owner":{"login":"zherczeg","id":2270193,"avatar_url":"https://avatars.githubusercontent.com/u/2270193?v=3","gravatar_id":"","url":"https://api.github.com/users/zherczeg","html_url":"https://github.com/zherczeg","followers_url":"https://api.github.com/users/zherczeg/followers","following_url":"https://api.github.com/users/zherczeg/following{/other_user}","gists_url":"https://api.github.com/users/zherczeg/gists{/gist_id}","starred_url":"https://api.github.com/users/zherczeg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zherczeg/subscriptions","organizations_url":"https://api.github.com/users/zherczeg/orgs","repos_url":"https://api.github.com/users/zherczeg/repos","events_url":"https://api.github.com/users/zherczeg/events{/privacy}","received_events_url":"https://api.github.com/users/zherczeg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zherczeg/jerryscript","description":"Ultra-lightweight JavaScript engine for Internet of Things. http://www.jerryscript.net","fork":true,"url":"https://api.github.com/repos/zherczeg/jerryscript","forks_url":"https://api.github.com/repos/zherczeg/jerryscript/forks","keys_url":"https://api.github.com/repos/zherczeg/jerryscript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zherczeg/jerryscript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zherczeg/jerryscript/teams","hooks_url":"https://api.github.com/repos/zherczeg/jerryscript/hooks","issue_events_url":"https://api.github.com/repos/zherczeg/jerryscript/issues/events{/number}","events_url":"https://api.github.com/repos/zherczeg/jerryscript/events","assignees_url":"https://api.github.com/repos/zherczeg/jerryscript/assignees{/user}","branches_url":"https://api.github.com/repos/zherczeg/jerryscript/branches{/branch}","tags_url":"https://api.github.com/repos/zherczeg/jerryscript/tags","blobs_url":"https://api.github.com/repos/zherczeg/jerryscript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zherczeg/jerryscript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zherczeg/jerryscript/git/refs{/sha}","trees_url":"https://api.github.com/repos/zherczeg/jerryscript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zherczeg/jerryscript/statuses/{sha}","languages_url":"https://api.github.com/repos/zherczeg/jerryscript/languages","stargazers_url":"https://api.github.com/repos/zherczeg/jerryscript/stargazers","contributors_url":"https://api.github.com/repos/zherczeg/jerryscript/contributors","subscribers_url":"https://api.github.com/repos/zherczeg/jerryscript/subscribers","subscription_url":"https://api.github.com/repos/zherczeg/jerryscript/subscription","commits_url":"https://api.github.com/repos/zherczeg/jerryscript/commits{/sha}","git_commits_url":"https://api.github.com/repos/zherczeg/jerryscript/git/commits{/sha}","comments_url":"https://api.github.com/repos/zherczeg/jerryscript/comments{/number}","issue_comment_url":"https://api.github.com/repos/zherczeg/jerryscript/issues/comments{/number}","contents_url":"https://api.github.com/repos/zherczeg/jerryscript/contents/{+path}","compare_url":"https://api.github.com/repos/zherczeg/jerryscript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zherczeg/jerryscript/merges","archive_url":"https://api.github.com/repos/zherczeg/jerryscript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zherczeg/jerryscript/downloads","issues_url":"https://api.github.com/repos/zherczeg/jerryscript/issues{/number}","pulls_url":"https://api.github.com/repos/zherczeg/jerryscript/pulls{/number}","milestones_url":"https://api.github.com/repos/zherczeg/jerryscript/milestones{/number}","notifications_url":"https://api.github.com/repos/zherczeg/jerryscript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zherczeg/jerryscript/labels{/name}","releases_url":"https://api.github.com/repos/zherczeg/jerryscript/releases{/id}","deployments_url":"https://api.github.com/repos/zherczeg/jerryscript/deployments","created_at":"2016-02-24T13:39:06Z","updated_at":"2016-02-24T13:39:10Z","pushed_at":"2016-03-11T09:10:42Z","git_url":"git://github.com/zherczeg/jerryscript.git","ssh_url":"git@github.com:zherczeg/jerryscript.git","clone_url":"https://github.com/zherczeg/jerryscript.git","svn_url":"https://github.com/zherczeg/jerryscript","homepage":"","size":6956,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Samsung:master","ref":"master","sha":"011dacd1a74bf06debc3e239723f322bb008daf5","user":{"login":"Samsung","id":6210390,"avatar_url":"https://avatars.githubusercontent.com/u/6210390?v=3","gravatar_id":"","url":"https://api.github.com/users/Samsung","html_url":"https://github.com/Samsung","followers_url":"https://api.github.com/users/Samsung/followers","following_url":"https://api.github.com/users/Samsung/following{/other_user}","gists_url":"https://api.github.com/users/Samsung/gists{/gist_id}","starred_url":"https://api.github.com/users/Samsung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Samsung/subscriptions","organizations_url":"https://api.github.com/users/Samsung/orgs","repos_url":"https://api.github.com/users/Samsung/repos","events_url":"https://api.github.com/users/Samsung/events{/privacy}","received_events_url":"https://api.github.com/users/Samsung/received_events","type":"Organization","site_admin":false},"repo":{"id":33339660,"name":"jerryscript","full_name":"Samsung/jerryscript","owner":{"login":"Samsung","id":6210390,"avatar_url":"https://avatars.githubusercontent.com/u/6210390?v=3","gravatar_id":"","url":"https://api.github.com/users/Samsung","html_url":"https://github.com/Samsung","followers_url":"https://api.github.com/users/Samsung/followers","following_url":"https://api.github.com/users/Samsung/following{/other_user}","gists_url":"https://api.github.com/users/Samsung/gists{/gist_id}","starred_url":"https://api.github.com/users/Samsung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Samsung/subscriptions","organizations_url":"https://api.github.com/users/Samsung/orgs","repos_url":"https://api.github.com/users/Samsung/repos","events_url":"https://api.github.com/users/Samsung/events{/privacy}","received_events_url":"https://api.github.com/users/Samsung/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Samsung/jerryscript","description":"Ultra-lightweight JavaScript engine for Internet of Things. http://www.jerryscript.net","fork":false,"url":"https://api.github.com/repos/Samsung/jerryscript","forks_url":"https://api.github.com/repos/Samsung/jerryscript/forks","keys_url":"https://api.github.com/repos/Samsung/jerryscript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Samsung/jerryscript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Samsung/jerryscript/teams","hooks_url":"https://api.github.com/repos/Samsung/jerryscript/hooks","issue_events_url":"https://api.github.com/repos/Samsung/jerryscript/issues/events{/number}","events_url":"https://api.github.com/repos/Samsung/jerryscript/events","assignees_url":"https://api.github.com/repos/Samsung/jerryscript/assignees{/user}","branches_url":"https://api.github.com/repos/Samsung/jerryscript/branches{/branch}","tags_url":"https://api.github.com/repos/Samsung/jerryscript/tags","blobs_url":"https://api.github.com/repos/Samsung/jerryscript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Samsung/jerryscript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Samsung/jerryscript/git/refs{/sha}","trees_url":"https://api.github.com/repos/Samsung/jerryscript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Samsung/jerryscript/statuses/{sha}","languages_url":"https://api.github.com/repos/Samsung/jerryscript/languages","stargazers_url":"https://api.github.com/repos/Samsung/jerryscript/stargazers","contributors_url":"https://api.github.com/repos/Samsung/jerryscript/contributors","subscribers_url":"https://api.github.com/repos/Samsung/jerryscript/subscribers","subscription_url":"https://api.github.com/repos/Samsung/jerryscript/subscription","commits_url":"https://api.github.com/repos/Samsung/jerryscript/commits{/sha}","git_commits_url":"https://api.github.com/repos/Samsung/jerryscript/git/commits{/sha}","comments_url":"https://api.github.com/repos/Samsung/jerryscript/comments{/number}","issue_comment_url":"https://api.github.com/repos/Samsung/jerryscript/issues/comments{/number}","contents_url":"https://api.github.com/repos/Samsung/jerryscript/contents/{+path}","compare_url":"https://api.github.com/repos/Samsung/jerryscript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Samsung/jerryscript/merges","archive_url":"https://api.github.com/repos/Samsung/jerryscript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Samsung/jerryscript/downloads","issues_url":"https://api.github.com/repos/Samsung/jerryscript/issues{/number}","pulls_url":"https://api.github.com/repos/Samsung/jerryscript/pulls{/number}","milestones_url":"https://api.github.com/repos/Samsung/jerryscript/milestones{/number}","notifications_url":"https://api.github.com/repos/Samsung/jerryscript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Samsung/jerryscript/labels{/name}","releases_url":"https://api.github.com/repos/Samsung/jerryscript/releases{/id}","deployments_url":"https://api.github.com/repos/Samsung/jerryscript/deployments","created_at":"2015-04-03T01:10:31Z","updated_at":"2016-03-11T07:14:02Z","pushed_at":"2016-03-11T09:53:27Z","git_url":"git://github.com/Samsung/jerryscript.git","ssh_url":"git@github.com:Samsung/jerryscript.git","clone_url":"https://github.com/Samsung/jerryscript.git","svn_url":"https://github.com/Samsung/jerryscript","homepage":"","size":10635,"stargazers_count":1197,"watchers_count":1197,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":121,"mirror_url":null,"open_issues_count":59,"forks":121,"open_issues":59,"watchers":1197,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Samsung/jerryscript/pulls/948"},"html":{"href":"https://github.com/Samsung/jerryscript/pull/948"},"issue":{"href":"https://api.github.com/repos/Samsung/jerryscript/issues/948"},"comments":{"href":"https://api.github.com/repos/Samsung/jerryscript/issues/948/comments"},"review_comments":{"href":"https://api.github.com/repos/Samsung/jerryscript/pulls/948/comments"},"review_comment":{"href":"https://api.github.com/repos/Samsung/jerryscript/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Samsung/jerryscript/pulls/948/commits"},"statuses":{"href":"https://api.github.com/repos/Samsung/jerryscript/statuses/66bba0b89a79a536507edd802f94af3fdb2acbbc"}}}}