{"action":"created","comment":{"url":"https://api.github.com/repos/metaeducation/ren-c/pulls/comments/130986608","pull_request_review_id":53921742,"id":130986608,"diff_hunk":"@@ -355,9 +406,10 @@ REBSER *Decompress(\n \n     // Since the initialization succeeded, go ahead and make the output buffer\n     //\n-    REBSER *output = Make_Binary(buf_size);\n+    REBSER *output = Make_Binary(sizeof(REBSER*) + buf_size);\n+    *cast(REBSER**, BIN_HEAD(output)) = output; // self-referential prefix\n     strm.avail_out = buf_size;\n-    strm.next_out = BIN_HEAD(output);\n+    strm.next_out = BIN_HEAD(output) + sizeof(REBSER*);\n ","path":"src/core/u-compress.c","position":203,"original_position":203,"commit_id":"855f9eed9bb85b825c00e087aceb03d3d93a51bd","original_commit_id":"855f9eed9bb85b825c00e087aceb03d3d93a51bd","user":{"login":"hostilefork","id":20440,"avatar_url":"https://avatars1.githubusercontent.com/u/20440?v=4","gravatar_id":"","url":"https://api.github.com/users/hostilefork","html_url":"https://github.com/hostilefork","followers_url":"https://api.github.com/users/hostilefork/followers","following_url":"https://api.github.com/users/hostilefork/following{/other_user}","gists_url":"https://api.github.com/users/hostilefork/gists{/gist_id}","starred_url":"https://api.github.com/users/hostilefork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hostilefork/subscriptions","organizations_url":"https://api.github.com/users/hostilefork/orgs","repos_url":"https://api.github.com/users/hostilefork/repos","events_url":"https://api.github.com/users/hostilefork/events{/privacy}","received_events_url":"https://api.github.com/users/hostilefork/received_events","type":"User","site_admin":false},"body":"My plan to use Rebol_Malloc() and Rebol_Realloc() directly, then have COMPRESS and DECOMPRESS be the ones who Rebserize.\r\n\r\nBut this is the reason I was bringing up the gzip default...I'm going to try to reign in these routines a bit more, in a compression-oriented commit.","created_at":"2017-08-02T20:25:50Z","updated_at":"2017-08-02T20:25:50Z","html_url":"https://github.com/metaeducation/ren-c/pull/606#discussion_r130986608","pull_request_url":"https://api.github.com/repos/metaeducation/ren-c/pulls/606","_links":{"self":{"href":"https://api.github.com/repos/metaeducation/ren-c/pulls/comments/130986608"},"html":{"href":"https://github.com/metaeducation/ren-c/pull/606#discussion_r130986608"},"pull_request":{"href":"https://api.github.com/repos/metaeducation/ren-c/pulls/606"}}},"pull_request":{"url":"https://api.github.com/repos/metaeducation/ren-c/pulls/606","id":133781713,"html_url":"https://github.com/metaeducation/ren-c/pull/606","diff_url":"https://github.com/metaeducation/ren-c/pull/606.diff","patch_url":"https://github.com/metaeducation/ren-c/pull/606.patch","issue_url":"https://api.github.com/repos/metaeducation/ren-c/issues/606","number":606,"state":"open","locked":false,"title":"Use LodePNG for decoding as well as encoding, kill %u-png.c","user":{"login":"hostilefork","id":20440,"avatar_url":"https://avatars1.githubusercontent.com/u/20440?v=4","gravatar_id":"","url":"https://api.github.com/users/hostilefork","html_url":"https://github.com/hostilefork","followers_url":"https://api.github.com/users/hostilefork/followers","following_url":"https://api.github.com/users/hostilefork/following{/other_user}","gists_url":"https://api.github.com/users/hostilefork/gists{/gist_id}","starred_url":"https://api.github.com/users/hostilefork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hostilefork/subscriptions","organizations_url":"https://api.github.com/users/hostilefork/orgs","repos_url":"https://api.github.com/users/hostilefork/repos","events_url":"https://api.github.com/users/hostilefork/events{/privacy}","received_events_url":"https://api.github.com/users/hostilefork/received_events","type":"User","site_admin":false},"body":"Due to a bug in the R3-Alpha custom PNG code (%u-png.c) related to\r\nencoding, Saphirion introduced a dependency on the lightweight single\r\nfile PNG encoder/decoder \"LodePNG\".  Including LodePNG meant including\r\na second implementation of inflate() and deflate(), which were already\r\npresent in Rebol as \"zlib\".  (%u-png.c reused this code)\r\n\r\nSo there were two PNG encoders and two zlibs in the EXE :-(\r\n\r\nThis commit brings LodePNG up to date with its master on GitHub, and\r\nuses it for PNG decoding as well...getting rid of %u-png.c.  It also\r\nuses the LodePNG option to plug in a custom zlib and not build its own.\r\nThis gets rid of the redundancy.\r\n\r\nAn optimization in the code makes it so that LodePNG uses a custom\r\nallocator that replaces malloc(), yet puts the data in a series.  The\r\ntrick is that the series stores a pointer to itself at the head of the\r\ndata, which can be hacked off by means of increasing the \"bias\"\r\n(unused capacity at the head of a series).  This permits buffers\r\nallocated by LodePNG to be tweaked for use to hand back to users,\r\nso no need to copy from malloc'd data into series data.\r\n\r\nBecause this \"Rebserize()\" feature is generically useful (and requires\r\nlow-level access to the memory structures) it is built as a generic\r\nservice in %m-pools.c.  Technically this commit does not really take\r\nadvantage of it yet, because IMAGE! does not use byte size series\r\nat the moment.  It probably should--and it may be easier than changing\r\nthe Rebserize() and associated allocators to manage the various\r\nissues involved in rounding the data and sizes.","created_at":"2017-08-02T18:50:39Z","updated_at":"2017-08-02T20:25:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"55a25e0f88aef53efc8d0af1e161f3bbd8ffc605","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/metaeducation/ren-c/pulls/606/commits","review_comments_url":"https://api.github.com/repos/metaeducation/ren-c/pulls/606/comments","review_comment_url":"https://api.github.com/repos/metaeducation/ren-c/pulls/comments{/number}","comments_url":"https://api.github.com/repos/metaeducation/ren-c/issues/606/comments","statuses_url":"https://api.github.com/repos/metaeducation/ren-c/statuses/855f9eed9bb85b825c00e087aceb03d3d93a51bd","head":{"label":"hostilefork:lodepng-decode","ref":"lodepng-decode","sha":"855f9eed9bb85b825c00e087aceb03d3d93a51bd","user":{"login":"hostilefork","id":20440,"avatar_url":"https://avatars1.githubusercontent.com/u/20440?v=4","gravatar_id":"","url":"https://api.github.com/users/hostilefork","html_url":"https://github.com/hostilefork","followers_url":"https://api.github.com/users/hostilefork/followers","following_url":"https://api.github.com/users/hostilefork/following{/other_user}","gists_url":"https://api.github.com/users/hostilefork/gists{/gist_id}","starred_url":"https://api.github.com/users/hostilefork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hostilefork/subscriptions","organizations_url":"https://api.github.com/users/hostilefork/orgs","repos_url":"https://api.github.com/users/hostilefork/repos","events_url":"https://api.github.com/users/hostilefork/events{/privacy}","received_events_url":"https://api.github.com/users/hostilefork/received_events","type":"User","site_admin":false},"repo":{"id":7182655,"name":"rebol","full_name":"hostilefork/rebol","owner":{"login":"hostilefork","id":20440,"avatar_url":"https://avatars1.githubusercontent.com/u/20440?v=4","gravatar_id":"","url":"https://api.github.com/users/hostilefork","html_url":"https://github.com/hostilefork","followers_url":"https://api.github.com/users/hostilefork/followers","following_url":"https://api.github.com/users/hostilefork/following{/other_user}","gists_url":"https://api.github.com/users/hostilefork/gists{/gist_id}","starred_url":"https://api.github.com/users/hostilefork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hostilefork/subscriptions","organizations_url":"https://api.github.com/users/hostilefork/orgs","repos_url":"https://api.github.com/users/hostilefork/repos","events_url":"https://api.github.com/users/hostilefork/events{/privacy}","received_events_url":"https://api.github.com/users/hostilefork/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hostilefork/rebol","description":"Source code for the Rebol interpreter","fork":true,"url":"https://api.github.com/repos/hostilefork/rebol","forks_url":"https://api.github.com/repos/hostilefork/rebol/forks","keys_url":"https://api.github.com/repos/hostilefork/rebol/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hostilefork/rebol/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hostilefork/rebol/teams","hooks_url":"https://api.github.com/repos/hostilefork/rebol/hooks","issue_events_url":"https://api.github.com/repos/hostilefork/rebol/issues/events{/number}","events_url":"https://api.github.com/repos/hostilefork/rebol/events","assignees_url":"https://api.github.com/repos/hostilefork/rebol/assignees{/user}","branches_url":"https://api.github.com/repos/hostilefork/rebol/branches{/branch}","tags_url":"https://api.github.com/repos/hostilefork/rebol/tags","blobs_url":"https://api.github.com/repos/hostilefork/rebol/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hostilefork/rebol/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hostilefork/rebol/git/refs{/sha}","trees_url":"https://api.github.com/repos/hostilefork/rebol/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hostilefork/rebol/statuses/{sha}","languages_url":"https://api.github.com/repos/hostilefork/rebol/languages","stargazers_url":"https://api.github.com/repos/hostilefork/rebol/stargazers","contributors_url":"https://api.github.com/repos/hostilefork/rebol/contributors","subscribers_url":"https://api.github.com/repos/hostilefork/rebol/subscribers","subscription_url":"https://api.github.com/repos/hostilefork/rebol/subscription","commits_url":"https://api.github.com/repos/hostilefork/rebol/commits{/sha}","git_commits_url":"https://api.github.com/repos/hostilefork/rebol/git/commits{/sha}","comments_url":"https://api.github.com/repos/hostilefork/rebol/comments{/number}","issue_comment_url":"https://api.github.com/repos/hostilefork/rebol/issues/comments{/number}","contents_url":"https://api.github.com/repos/hostilefork/rebol/contents/{+path}","compare_url":"https://api.github.com/repos/hostilefork/rebol/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hostilefork/rebol/merges","archive_url":"https://api.github.com/repos/hostilefork/rebol/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hostilefork/rebol/downloads","issues_url":"https://api.github.com/repos/hostilefork/rebol/issues{/number}","pulls_url":"https://api.github.com/repos/hostilefork/rebol/pulls{/number}","milestones_url":"https://api.github.com/repos/hostilefork/rebol/milestones{/number}","notifications_url":"https://api.github.com/repos/hostilefork/rebol/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hostilefork/rebol/labels{/name}","releases_url":"https://api.github.com/repos/hostilefork/rebol/releases{/id}","deployments_url":"https://api.github.com/repos/hostilefork/rebol/deployments","created_at":"2012-12-15T18:44:43Z","updated_at":"2017-07-07T20:46:30Z","pushed_at":"2017-08-02T18:50:30Z","git_url":"git://github.com/hostilefork/rebol.git","ssh_url":"git@github.com:hostilefork/rebol.git","clone_url":"https://github.com/hostilefork/rebol.git","svn_url":"https://github.com/hostilefork/rebol","homepage":"http://www.rebol.com/","size":60623,"stargazers_count":9,"watchers_count":9,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":0,"forks":3,"open_issues":0,"watchers":9,"default_branch":"master"}},"base":{"label":"metaeducation:master","ref":"master","sha":"4a3af55af023e70093d7ee9a910b144609bfcc86","user":{"login":"metaeducation","id":8308455,"avatar_url":"https://avatars0.githubusercontent.com/u/8308455?v=4","gravatar_id":"","url":"https://api.github.com/users/metaeducation","html_url":"https://github.com/metaeducation","followers_url":"https://api.github.com/users/metaeducation/followers","following_url":"https://api.github.com/users/metaeducation/following{/other_user}","gists_url":"https://api.github.com/users/metaeducation/gists{/gist_id}","starred_url":"https://api.github.com/users/metaeducation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metaeducation/subscriptions","organizations_url":"https://api.github.com/users/metaeducation/orgs","repos_url":"https://api.github.com/users/metaeducation/repos","events_url":"https://api.github.com/users/metaeducation/events{/privacy}","received_events_url":"https://api.github.com/users/metaeducation/received_events","type":"Organization","site_admin":false},"repo":{"id":35589720,"name":"ren-c","full_name":"metaeducation/ren-c","owner":{"login":"metaeducation","id":8308455,"avatar_url":"https://avatars0.githubusercontent.com/u/8308455?v=4","gravatar_id":"","url":"https://api.github.com/users/metaeducation","html_url":"https://github.com/metaeducation","followers_url":"https://api.github.com/users/metaeducation/followers","following_url":"https://api.github.com/users/metaeducation/following{/other_user}","gists_url":"https://api.github.com/users/metaeducation/gists{/gist_id}","starred_url":"https://api.github.com/users/metaeducation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metaeducation/subscriptions","organizations_url":"https://api.github.com/users/metaeducation/orgs","repos_url":"https://api.github.com/users/metaeducation/repos","events_url":"https://api.github.com/users/metaeducation/events{/privacy}","received_events_url":"https://api.github.com/users/metaeducation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/metaeducation/ren-c","description":"Library for embedding a Rebol interpreter into C codebases","fork":true,"url":"https://api.github.com/repos/metaeducation/ren-c","forks_url":"https://api.github.com/repos/metaeducation/ren-c/forks","keys_url":"https://api.github.com/repos/metaeducation/ren-c/keys{/key_id}","collaborators_url":"https://api.github.com/repos/metaeducation/ren-c/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/metaeducation/ren-c/teams","hooks_url":"https://api.github.com/repos/metaeducation/ren-c/hooks","issue_events_url":"https://api.github.com/repos/metaeducation/ren-c/issues/events{/number}","events_url":"https://api.github.com/repos/metaeducation/ren-c/events","assignees_url":"https://api.github.com/repos/metaeducation/ren-c/assignees{/user}","branches_url":"https://api.github.com/repos/metaeducation/ren-c/branches{/branch}","tags_url":"https://api.github.com/repos/metaeducation/ren-c/tags","blobs_url":"https://api.github.com/repos/metaeducation/ren-c/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/metaeducation/ren-c/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/metaeducation/ren-c/git/refs{/sha}","trees_url":"https://api.github.com/repos/metaeducation/ren-c/git/trees{/sha}","statuses_url":"https://api.github.com/repos/metaeducation/ren-c/statuses/{sha}","languages_url":"https://api.github.com/repos/metaeducation/ren-c/languages","stargazers_url":"https://api.github.com/repos/metaeducation/ren-c/stargazers","contributors_url":"https://api.github.com/repos/metaeducation/ren-c/contributors","subscribers_url":"https://api.github.com/repos/metaeducation/ren-c/subscribers","subscription_url":"https://api.github.com/repos/metaeducation/ren-c/subscription","commits_url":"https://api.github.com/repos/metaeducation/ren-c/commits{/sha}","git_commits_url":"https://api.github.com/repos/metaeducation/ren-c/git/commits{/sha}","comments_url":"https://api.github.com/repos/metaeducation/ren-c/comments{/number}","issue_comment_url":"https://api.github.com/repos/metaeducation/ren-c/issues/comments{/number}","contents_url":"https://api.github.com/repos/metaeducation/ren-c/contents/{+path}","compare_url":"https://api.github.com/repos/metaeducation/ren-c/compare/{base}...{head}","merges_url":"https://api.github.com/repos/metaeducation/ren-c/merges","archive_url":"https://api.github.com/repos/metaeducation/ren-c/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/metaeducation/ren-c/downloads","issues_url":"https://api.github.com/repos/metaeducation/ren-c/issues{/number}","pulls_url":"https://api.github.com/repos/metaeducation/ren-c/pulls{/number}","milestones_url":"https://api.github.com/repos/metaeducation/ren-c/milestones{/number}","notifications_url":"https://api.github.com/repos/metaeducation/ren-c/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/metaeducation/ren-c/labels{/name}","releases_url":"https://api.github.com/repos/metaeducation/ren-c/releases{/id}","deployments_url":"https://api.github.com/repos/metaeducation/ren-c/deployments","created_at":"2015-05-14T03:55:55Z","updated_at":"2017-07-08T19:05:28Z","pushed_at":"2017-08-02T18:50:40Z","git_url":"git://github.com/metaeducation/ren-c.git","ssh_url":"git@github.com:metaeducation/ren-c.git","clone_url":"https://github.com/metaeducation/ren-c.git","svn_url":"https://github.com/metaeducation/ren-c","homepage":"","size":60414,"stargazers_count":47,"watchers_count":47,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":51,"forks":15,"open_issues":51,"watchers":47,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/metaeducation/ren-c/pulls/606"},"html":{"href":"https://github.com/metaeducation/ren-c/pull/606"},"issue":{"href":"https://api.github.com/repos/metaeducation/ren-c/issues/606"},"comments":{"href":"https://api.github.com/repos/metaeducation/ren-c/issues/606/comments"},"review_comments":{"href":"https://api.github.com/repos/metaeducation/ren-c/pulls/606/comments"},"review_comment":{"href":"https://api.github.com/repos/metaeducation/ren-c/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/metaeducation/ren-c/pulls/606/commits"},"statuses":{"href":"https://api.github.com/repos/metaeducation/ren-c/statuses/855f9eed9bb85b825c00e087aceb03d3d93a51bd"}}}}
{"actor":{"display_login":"hostilefork"}}