{"action":"created","comment":{"url":"https://api.github.com/repos/Cyan4973/zstd/pulls/comments/65676932","id":65676932,"diff_hunk":"@@ -67,29 +69,52 @@ static int g_useZSTD = ZWRAP_USE_ZSTD;   /* 0 = don't use ZSTD */\n \n void useZSTD(int turn_on) { g_useZSTD = turn_on; }\n \n-int isUsingZSTD() { return g_useZSTD; }\n+int isUsingZSTD(void) { return g_useZSTD; }\n \n-const char * zstdVersion() { return ZSTD_VERSION_STRING; }\n+const char * zstdVersion(void) { return ZSTD_VERSION_STRING; }\n \n ZEXTERN const char * ZEXPORT z_zlibVersion OF((void)) { return zlibVersion();  }\n \n \n+static void* ZWRAP_allocFunction(void* opaque, size_t size)\n+{\n+    z_streamp strm = (z_streamp) opaque;\n+    void* address = strm->zalloc(strm->opaque, 1, size);\n+  /*  printf(\"ZWRAP alloc %p, %d \\n\", address, (int)size); */\n+    return address;\n+}\n+\n+static void ZWRAP_freeFunction(void* opaque, void* address)\n+{\n+    z_streamp strm = (z_streamp) opaque;\n+    strm->zfree(strm->opaque, address);\n+   /* if (address) printf(\"ZWRAP free %p \\n\", address); */\n+}\n+\n+\n \n /* *** Compression *** */\n \n typedef struct {\n     ZBUFF_CCtx* zbc;\n     size_t bytesLeft;\n     int compressionLevel;\n+    z_stream allocFunc; /* copy of zalloc, zfree, opaque */","path":"zlibWrapper/zstd_zlibwrapper.c","position":50,"original_position":50,"commit_id":"aa224c0205eed233bd11cfeeb0b1e2f6d42eb26c","original_commit_id":"aa224c0205eed233bd11cfeeb0b1e2f6d42eb26c","user":{"login":"Cyan4973","id":750081,"avatar_url":"https://avatars.githubusercontent.com/u/750081?v=3","gravatar_id":"","url":"https://api.github.com/users/Cyan4973","html_url":"https://github.com/Cyan4973","followers_url":"https://api.github.com/users/Cyan4973/followers","following_url":"https://api.github.com/users/Cyan4973/following{/other_user}","gists_url":"https://api.github.com/users/Cyan4973/gists{/gist_id}","starred_url":"https://api.github.com/users/Cyan4973/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cyan4973/subscriptions","organizations_url":"https://api.github.com/users/Cyan4973/orgs","repos_url":"https://api.github.com/users/Cyan4973/repos","events_url":"https://api.github.com/users/Cyan4973/events{/privacy}","received_events_url":"https://api.github.com/users/Cyan4973/received_events","type":"User","site_admin":false},"body":"Is it a kind of circular reference,\r\nwhere `z_stream` reference `opaque` which is in fact `ZWRAP_CCtx` type which reference the same `z_stream` ?","created_at":"2016-06-03T09:03:26Z","updated_at":"2016-06-03T09:03:26Z","html_url":"https://github.com/Cyan4973/zstd/pull/198#discussion_r65676932","pull_request_url":"https://api.github.com/repos/Cyan4973/zstd/pulls/198","_links":{"self":{"href":"https://api.github.com/repos/Cyan4973/zstd/pulls/comments/65676932"},"html":{"href":"https://github.com/Cyan4973/zstd/pull/198#discussion_r65676932"},"pull_request":{"href":"https://api.github.com/repos/Cyan4973/zstd/pulls/198"}}},"pull_request":{"url":"https://api.github.com/repos/Cyan4973/zstd/pulls/198","id":72319209,"html_url":"https://github.com/Cyan4973/zstd/pull/198","diff_url":"https://github.com/Cyan4973/zstd/pull/198.diff","patch_url":"https://github.com/Cyan4973/zstd/pull/198.patch","issue_url":"https://api.github.com/repos/Cyan4973/zstd/issues/198","number":198,"state":"open","locked":false,"title":"Dev070","user":{"login":"inikep","id":15112322,"avatar_url":"https://avatars.githubusercontent.com/u/15112322?v=3","gravatar_id":"","url":"https://api.github.com/users/inikep","html_url":"https://github.com/inikep","followers_url":"https://api.github.com/users/inikep/followers","following_url":"https://api.github.com/users/inikep/following{/other_user}","gists_url":"https://api.github.com/users/inikep/gists{/gist_id}","starred_url":"https://api.github.com/users/inikep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inikep/subscriptions","organizations_url":"https://api.github.com/users/inikep/orgs","repos_url":"https://api.github.com/users/inikep/repos","events_url":"https://api.github.com/users/inikep/events{/privacy}","received_events_url":"https://api.github.com/users/inikep/received_events","type":"User","site_admin":false},"body":null,"created_at":"2016-06-02T10:01:05Z","updated_at":"2016-06-03T09:03:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ec02aecc93dd26b711dd82711b9c4ba422ccfdd3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Cyan4973/zstd/pulls/198/commits","review_comments_url":"https://api.github.com/repos/Cyan4973/zstd/pulls/198/comments","review_comment_url":"https://api.github.com/repos/Cyan4973/zstd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Cyan4973/zstd/issues/198/comments","statuses_url":"https://api.github.com/repos/Cyan4973/zstd/statuses/aa224c0205eed233bd11cfeeb0b1e2f6d42eb26c","head":{"label":"inikep:dev070","ref":"dev070","sha":"aa224c0205eed233bd11cfeeb0b1e2f6d42eb26c","user":{"login":"inikep","id":15112322,"avatar_url":"https://avatars.githubusercontent.com/u/15112322?v=3","gravatar_id":"","url":"https://api.github.com/users/inikep","html_url":"https://github.com/inikep","followers_url":"https://api.github.com/users/inikep/followers","following_url":"https://api.github.com/users/inikep/following{/other_user}","gists_url":"https://api.github.com/users/inikep/gists{/gist_id}","starred_url":"https://api.github.com/users/inikep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inikep/subscriptions","organizations_url":"https://api.github.com/users/inikep/orgs","repos_url":"https://api.github.com/users/inikep/repos","events_url":"https://api.github.com/users/inikep/events{/privacy}","received_events_url":"https://api.github.com/users/inikep/received_events","type":"User","site_admin":false},"repo":{"id":52074770,"name":"zstd","full_name":"inikep/zstd","owner":{"login":"inikep","id":15112322,"avatar_url":"https://avatars.githubusercontent.com/u/15112322?v=3","gravatar_id":"","url":"https://api.github.com/users/inikep","html_url":"https://github.com/inikep","followers_url":"https://api.github.com/users/inikep/followers","following_url":"https://api.github.com/users/inikep/following{/other_user}","gists_url":"https://api.github.com/users/inikep/gists{/gist_id}","starred_url":"https://api.github.com/users/inikep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inikep/subscriptions","organizations_url":"https://api.github.com/users/inikep/orgs","repos_url":"https://api.github.com/users/inikep/repos","events_url":"https://api.github.com/users/inikep/events{/privacy}","received_events_url":"https://api.github.com/users/inikep/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/inikep/zstd","description":"Zstandard - Fast real-time compression algorithm","fork":true,"url":"https://api.github.com/repos/inikep/zstd","forks_url":"https://api.github.com/repos/inikep/zstd/forks","keys_url":"https://api.github.com/repos/inikep/zstd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/inikep/zstd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/inikep/zstd/teams","hooks_url":"https://api.github.com/repos/inikep/zstd/hooks","issue_events_url":"https://api.github.com/repos/inikep/zstd/issues/events{/number}","events_url":"https://api.github.com/repos/inikep/zstd/events","assignees_url":"https://api.github.com/repos/inikep/zstd/assignees{/user}","branches_url":"https://api.github.com/repos/inikep/zstd/branches{/branch}","tags_url":"https://api.github.com/repos/inikep/zstd/tags","blobs_url":"https://api.github.com/repos/inikep/zstd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/inikep/zstd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/inikep/zstd/git/refs{/sha}","trees_url":"https://api.github.com/repos/inikep/zstd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/inikep/zstd/statuses/{sha}","languages_url":"https://api.github.com/repos/inikep/zstd/languages","stargazers_url":"https://api.github.com/repos/inikep/zstd/stargazers","contributors_url":"https://api.github.com/repos/inikep/zstd/contributors","subscribers_url":"https://api.github.com/repos/inikep/zstd/subscribers","subscription_url":"https://api.github.com/repos/inikep/zstd/subscription","commits_url":"https://api.github.com/repos/inikep/zstd/commits{/sha}","git_commits_url":"https://api.github.com/repos/inikep/zstd/git/commits{/sha}","comments_url":"https://api.github.com/repos/inikep/zstd/comments{/number}","issue_comment_url":"https://api.github.com/repos/inikep/zstd/issues/comments{/number}","contents_url":"https://api.github.com/repos/inikep/zstd/contents/{+path}","compare_url":"https://api.github.com/repos/inikep/zstd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/inikep/zstd/merges","archive_url":"https://api.github.com/repos/inikep/zstd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/inikep/zstd/downloads","issues_url":"https://api.github.com/repos/inikep/zstd/issues{/number}","pulls_url":"https://api.github.com/repos/inikep/zstd/pulls{/number}","milestones_url":"https://api.github.com/repos/inikep/zstd/milestones{/number}","notifications_url":"https://api.github.com/repos/inikep/zstd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/inikep/zstd/labels{/name}","releases_url":"https://api.github.com/repos/inikep/zstd/releases{/id}","deployments_url":"https://api.github.com/repos/inikep/zstd/deployments","created_at":"2016-02-19T08:56:46Z","updated_at":"2016-02-26T06:44:41Z","pushed_at":"2016-06-02T20:24:43Z","git_url":"git://github.com/inikep/zstd.git","ssh_url":"git@github.com:inikep/zstd.git","clone_url":"https://github.com/inikep/zstd.git","svn_url":"https://github.com/inikep/zstd","homepage":"http://www.zstd.net","size":3287,"stargazers_count":2,"watchers_count":2,"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":2,"default_branch":"dev"}},"base":{"label":"Cyan4973:dev070","ref":"dev070","sha":"923938edde18f6aeaf3dd705cf8ed73e4ad67a6a","user":{"login":"Cyan4973","id":750081,"avatar_url":"https://avatars.githubusercontent.com/u/750081?v=3","gravatar_id":"","url":"https://api.github.com/users/Cyan4973","html_url":"https://github.com/Cyan4973","followers_url":"https://api.github.com/users/Cyan4973/followers","following_url":"https://api.github.com/users/Cyan4973/following{/other_user}","gists_url":"https://api.github.com/users/Cyan4973/gists{/gist_id}","starred_url":"https://api.github.com/users/Cyan4973/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cyan4973/subscriptions","organizations_url":"https://api.github.com/users/Cyan4973/orgs","repos_url":"https://api.github.com/users/Cyan4973/repos","events_url":"https://api.github.com/users/Cyan4973/events{/privacy}","received_events_url":"https://api.github.com/users/Cyan4973/received_events","type":"User","site_admin":false},"repo":{"id":29759715,"name":"zstd","full_name":"Cyan4973/zstd","owner":{"login":"Cyan4973","id":750081,"avatar_url":"https://avatars.githubusercontent.com/u/750081?v=3","gravatar_id":"","url":"https://api.github.com/users/Cyan4973","html_url":"https://github.com/Cyan4973","followers_url":"https://api.github.com/users/Cyan4973/followers","following_url":"https://api.github.com/users/Cyan4973/following{/other_user}","gists_url":"https://api.github.com/users/Cyan4973/gists{/gist_id}","starred_url":"https://api.github.com/users/Cyan4973/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cyan4973/subscriptions","organizations_url":"https://api.github.com/users/Cyan4973/orgs","repos_url":"https://api.github.com/users/Cyan4973/repos","events_url":"https://api.github.com/users/Cyan4973/events{/privacy}","received_events_url":"https://api.github.com/users/Cyan4973/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Cyan4973/zstd","description":"Zstandard - Fast real-time compression algorithm","fork":false,"url":"https://api.github.com/repos/Cyan4973/zstd","forks_url":"https://api.github.com/repos/Cyan4973/zstd/forks","keys_url":"https://api.github.com/repos/Cyan4973/zstd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Cyan4973/zstd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Cyan4973/zstd/teams","hooks_url":"https://api.github.com/repos/Cyan4973/zstd/hooks","issue_events_url":"https://api.github.com/repos/Cyan4973/zstd/issues/events{/number}","events_url":"https://api.github.com/repos/Cyan4973/zstd/events","assignees_url":"https://api.github.com/repos/Cyan4973/zstd/assignees{/user}","branches_url":"https://api.github.com/repos/Cyan4973/zstd/branches{/branch}","tags_url":"https://api.github.com/repos/Cyan4973/zstd/tags","blobs_url":"https://api.github.com/repos/Cyan4973/zstd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Cyan4973/zstd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Cyan4973/zstd/git/refs{/sha}","trees_url":"https://api.github.com/repos/Cyan4973/zstd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Cyan4973/zstd/statuses/{sha}","languages_url":"https://api.github.com/repos/Cyan4973/zstd/languages","stargazers_url":"https://api.github.com/repos/Cyan4973/zstd/stargazers","contributors_url":"https://api.github.com/repos/Cyan4973/zstd/contributors","subscribers_url":"https://api.github.com/repos/Cyan4973/zstd/subscribers","subscription_url":"https://api.github.com/repos/Cyan4973/zstd/subscription","commits_url":"https://api.github.com/repos/Cyan4973/zstd/commits{/sha}","git_commits_url":"https://api.github.com/repos/Cyan4973/zstd/git/commits{/sha}","comments_url":"https://api.github.com/repos/Cyan4973/zstd/comments{/number}","issue_comment_url":"https://api.github.com/repos/Cyan4973/zstd/issues/comments{/number}","contents_url":"https://api.github.com/repos/Cyan4973/zstd/contents/{+path}","compare_url":"https://api.github.com/repos/Cyan4973/zstd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Cyan4973/zstd/merges","archive_url":"https://api.github.com/repos/Cyan4973/zstd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Cyan4973/zstd/downloads","issues_url":"https://api.github.com/repos/Cyan4973/zstd/issues{/number}","pulls_url":"https://api.github.com/repos/Cyan4973/zstd/pulls{/number}","milestones_url":"https://api.github.com/repos/Cyan4973/zstd/milestones{/number}","notifications_url":"https://api.github.com/repos/Cyan4973/zstd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Cyan4973/zstd/labels{/name}","releases_url":"https://api.github.com/repos/Cyan4973/zstd/releases{/id}","deployments_url":"https://api.github.com/repos/Cyan4973/zstd/deployments","created_at":"2015-01-24T00:22:38Z","updated_at":"2016-06-02T16:17:44Z","pushed_at":"2016-06-02T20:24:43Z","git_url":"git://github.com/Cyan4973/zstd.git","ssh_url":"git@github.com:Cyan4973/zstd.git","clone_url":"https://github.com/Cyan4973/zstd.git","svn_url":"https://github.com/Cyan4973/zstd","homepage":"http://www.zstd.net","size":4256,"stargazers_count":938,"watchers_count":938,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":67,"mirror_url":null,"open_issues_count":9,"forks":67,"open_issues":9,"watchers":938,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Cyan4973/zstd/pulls/198"},"html":{"href":"https://github.com/Cyan4973/zstd/pull/198"},"issue":{"href":"https://api.github.com/repos/Cyan4973/zstd/issues/198"},"comments":{"href":"https://api.github.com/repos/Cyan4973/zstd/issues/198/comments"},"review_comments":{"href":"https://api.github.com/repos/Cyan4973/zstd/pulls/198/comments"},"review_comment":{"href":"https://api.github.com/repos/Cyan4973/zstd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Cyan4973/zstd/pulls/198/commits"},"statuses":{"href":"https://api.github.com/repos/Cyan4973/zstd/statuses/aa224c0205eed233bd11cfeeb0b1e2f6d42eb26c"}}}}
{"actor":{"display_login":"Cyan4973"}}