{"action":"created","comment":{"url":"https://api.github.com/repos/libuv/libuv/pulls/comments/24025458","id":24025458,"diff_hunk":"@@ -243,6 +243,11 @@ typedef enum {\n UV_EXTERN unsigned int uv_version(void);\n UV_EXTERN const char* uv_version_string(void);\n \n+typedef void* (*uv_malloc_cb)(size_t size);\n+typedef void (*uv_free_cb)(void* ptr);\n+\n+UV_EXTERN void uv_replace_allocator(uv_malloc_cb malloc_cb, uv_free_cb free_cb);","path":"include/uv.h","position":null,"original_position":7,"commit_id":"f7e02c6098992dd59b19abb4c88e5f1722bd8e2f","original_commit_id":"88b9e6cc384e312042abcaa70a86007149b0a101","user":{"login":"saghul","id":317464,"avatar_url":"https://avatars.githubusercontent.com/u/317464?v=3","gravatar_id":"","url":"https://api.github.com/users/saghul","html_url":"https://github.com/saghul","followers_url":"https://api.github.com/users/saghul/followers","following_url":"https://api.github.com/users/saghul/following{/other_user}","gists_url":"https://api.github.com/users/saghul/gists{/gist_id}","starred_url":"https://api.github.com/users/saghul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saghul/subscriptions","organizations_url":"https://api.github.com/users/saghul/orgs","repos_url":"https://api.github.com/users/saghul/repos","events_url":"https://api.github.com/users/saghul/events{/privacy}","received_events_url":"https://api.github.com/users/saghul/received_events","type":"User","site_admin":false},"body":"Great, thanks! Don't do the single function thing for now, it was just a\r\nquick suggestion I'd like more input on.\r\nOn Feb 3, 2015 6:44 PM, \"Brett Vickers\" <notifications@github.com> wrote:\r\n\r\n> In include/uv.h\r\n> <https://github.com/libuv/libuv/pull/178#discussion_r24022766>:\r\n>\r\n> > @@ -243,6 +243,11 @@ typedef enum {\r\n> >  UV_EXTERN unsigned int uv_version(void);\r\n> >  UV_EXTERN const char* uv_version_string(void);\r\n> >\r\n> > +typedef void* (*uv_malloc_cb)(size_t size);\r\n> > +typedef void (*uv_free_cb)(void* ptr);\r\n> > +\r\n> > +UV_EXTERN void uv_replace_allocator(uv_malloc_cb malloc_cb, uv_free_cb free_cb);\r\n>\r\n> As someone who is often \"that guy\", I totally get it. :-) I'm happy to use\r\n> the func prefix. Will make that change.\r\n>\r\n> Re: a single allocator function for free and malloc, I'm happy to do that\r\n> too if you don't think it'll be too wonky. It's the kind of thing that\r\n> would probably require a non-trivial comment explaining it.\r\n>\r\n> —\r\n> Reply to this email directly or view it on GitHub\r\n> <https://github.com/libuv/libuv/pull/178/files#r24022766>.\r\n>","created_at":"2015-02-03T18:21:27Z","updated_at":"2015-02-03T18:21:27Z","html_url":"https://github.com/libuv/libuv/pull/178#discussion_r24025458","pull_request_url":"https://api.github.com/repos/libuv/libuv/pulls/178","_links":{"self":{"href":"https://api.github.com/repos/libuv/libuv/pulls/comments/24025458"},"html":{"href":"https://github.com/libuv/libuv/pull/178#discussion_r24025458"},"pull_request":{"href":"https://api.github.com/repos/libuv/libuv/pulls/178"}}},"pull_request":{"url":"https://api.github.com/repos/libuv/libuv/pulls/178","id":28418776,"html_url":"https://github.com/libuv/libuv/pull/178","diff_url":"https://github.com/libuv/libuv/pull/178.diff","patch_url":"https://github.com/libuv/libuv/pull/178.patch","issue_url":"https://api.github.com/repos/libuv/libuv/issues/178","number":178,"state":"open","locked":false,"title":"Memory allocator can be customized.","user":{"login":"beevik","id":466481,"avatar_url":"https://avatars.githubusercontent.com/u/466481?v=3","gravatar_id":"","url":"https://api.github.com/users/beevik","html_url":"https://github.com/beevik","followers_url":"https://api.github.com/users/beevik/followers","following_url":"https://api.github.com/users/beevik/following{/other_user}","gists_url":"https://api.github.com/users/beevik/gists{/gist_id}","starred_url":"https://api.github.com/users/beevik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beevik/subscriptions","organizations_url":"https://api.github.com/users/beevik/orgs","repos_url":"https://api.github.com/users/beevik/repos","events_url":"https://api.github.com/users/beevik/events{/privacy}","received_events_url":"https://api.github.com/users/beevik/received_events","type":"User","site_admin":false},"body":"Added uv_replace_allocator.\r\nReplaced all calls to malloc/free with calls to uv_malloc/uv_free.\r\nWrote aligned malloc and free functions to replace windows _aligned_malloc/_aligned_free.","created_at":"2015-01-31T18:37:18Z","updated_at":"2015-02-03T18:21:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"22ef56da84844fe9aa65d0cf2d3dccc94b28cf2d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/libuv/libuv/pulls/178/commits","review_comments_url":"https://api.github.com/repos/libuv/libuv/pulls/178/comments","review_comment_url":"https://api.github.com/repos/libuv/libuv/pulls/comments/{number}","comments_url":"https://api.github.com/repos/libuv/libuv/issues/178/comments","statuses_url":"https://api.github.com/repos/libuv/libuv/statuses/f7e02c6098992dd59b19abb4c88e5f1722bd8e2f","head":{"label":"beevik:v1.x","ref":"v1.x","sha":"f7e02c6098992dd59b19abb4c88e5f1722bd8e2f","user":{"login":"beevik","id":466481,"avatar_url":"https://avatars.githubusercontent.com/u/466481?v=3","gravatar_id":"","url":"https://api.github.com/users/beevik","html_url":"https://github.com/beevik","followers_url":"https://api.github.com/users/beevik/followers","following_url":"https://api.github.com/users/beevik/following{/other_user}","gists_url":"https://api.github.com/users/beevik/gists{/gist_id}","starred_url":"https://api.github.com/users/beevik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beevik/subscriptions","organizations_url":"https://api.github.com/users/beevik/orgs","repos_url":"https://api.github.com/users/beevik/repos","events_url":"https://api.github.com/users/beevik/events{/privacy}","received_events_url":"https://api.github.com/users/beevik/received_events","type":"User","site_admin":false},"repo":{"id":30121753,"name":"libuv","full_name":"beevik/libuv","owner":{"login":"beevik","id":466481,"avatar_url":"https://avatars.githubusercontent.com/u/466481?v=3","gravatar_id":"","url":"https://api.github.com/users/beevik","html_url":"https://github.com/beevik","followers_url":"https://api.github.com/users/beevik/followers","following_url":"https://api.github.com/users/beevik/following{/other_user}","gists_url":"https://api.github.com/users/beevik/gists{/gist_id}","starred_url":"https://api.github.com/users/beevik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beevik/subscriptions","organizations_url":"https://api.github.com/users/beevik/orgs","repos_url":"https://api.github.com/users/beevik/repos","events_url":"https://api.github.com/users/beevik/events{/privacy}","received_events_url":"https://api.github.com/users/beevik/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/beevik/libuv","description":"Cross-platform asychronous I/O","fork":true,"url":"https://api.github.com/repos/beevik/libuv","forks_url":"https://api.github.com/repos/beevik/libuv/forks","keys_url":"https://api.github.com/repos/beevik/libuv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/beevik/libuv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/beevik/libuv/teams","hooks_url":"https://api.github.com/repos/beevik/libuv/hooks","issue_events_url":"https://api.github.com/repos/beevik/libuv/issues/events{/number}","events_url":"https://api.github.com/repos/beevik/libuv/events","assignees_url":"https://api.github.com/repos/beevik/libuv/assignees{/user}","branches_url":"https://api.github.com/repos/beevik/libuv/branches{/branch}","tags_url":"https://api.github.com/repos/beevik/libuv/tags","blobs_url":"https://api.github.com/repos/beevik/libuv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/beevik/libuv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/beevik/libuv/git/refs{/sha}","trees_url":"https://api.github.com/repos/beevik/libuv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/beevik/libuv/statuses/{sha}","languages_url":"https://api.github.com/repos/beevik/libuv/languages","stargazers_url":"https://api.github.com/repos/beevik/libuv/stargazers","contributors_url":"https://api.github.com/repos/beevik/libuv/contributors","subscribers_url":"https://api.github.com/repos/beevik/libuv/subscribers","subscription_url":"https://api.github.com/repos/beevik/libuv/subscription","commits_url":"https://api.github.com/repos/beevik/libuv/commits{/sha}","git_commits_url":"https://api.github.com/repos/beevik/libuv/git/commits{/sha}","comments_url":"https://api.github.com/repos/beevik/libuv/comments{/number}","issue_comment_url":"https://api.github.com/repos/beevik/libuv/issues/comments/{number}","contents_url":"https://api.github.com/repos/beevik/libuv/contents/{+path}","compare_url":"https://api.github.com/repos/beevik/libuv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/beevik/libuv/merges","archive_url":"https://api.github.com/repos/beevik/libuv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/beevik/libuv/downloads","issues_url":"https://api.github.com/repos/beevik/libuv/issues{/number}","pulls_url":"https://api.github.com/repos/beevik/libuv/pulls{/number}","milestones_url":"https://api.github.com/repos/beevik/libuv/milestones{/number}","notifications_url":"https://api.github.com/repos/beevik/libuv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/beevik/libuv/labels{/name}","releases_url":"https://api.github.com/repos/beevik/libuv/releases{/id}","created_at":"2015-01-31T18:31:04Z","updated_at":"2015-02-03T18:13:13Z","pushed_at":"2015-02-03T18:13:13Z","git_url":"git://github.com/beevik/libuv.git","ssh_url":"git@github.com:beevik/libuv.git","clone_url":"https://github.com/beevik/libuv.git","svn_url":"https://github.com/beevik/libuv","homepage":"http://libuv.org/","size":16269,"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":"v1.x"}},"base":{"label":"libuv:v1.x","ref":"v1.x","sha":"5a52cc146e04feb68b9c2cd6bcd17196ce59e16e","user":{"login":"libuv","id":4030929,"avatar_url":"https://avatars.githubusercontent.com/u/4030929?v=3","gravatar_id":"","url":"https://api.github.com/users/libuv","html_url":"https://github.com/libuv","followers_url":"https://api.github.com/users/libuv/followers","following_url":"https://api.github.com/users/libuv/following{/other_user}","gists_url":"https://api.github.com/users/libuv/gists{/gist_id}","starred_url":"https://api.github.com/users/libuv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libuv/subscriptions","organizations_url":"https://api.github.com/users/libuv/orgs","repos_url":"https://api.github.com/users/libuv/repos","events_url":"https://api.github.com/users/libuv/events{/privacy}","received_events_url":"https://api.github.com/users/libuv/received_events","type":"Organization","site_admin":false},"repo":{"id":14812739,"name":"libuv","full_name":"libuv/libuv","owner":{"login":"libuv","id":4030929,"avatar_url":"https://avatars.githubusercontent.com/u/4030929?v=3","gravatar_id":"","url":"https://api.github.com/users/libuv","html_url":"https://github.com/libuv","followers_url":"https://api.github.com/users/libuv/followers","following_url":"https://api.github.com/users/libuv/following{/other_user}","gists_url":"https://api.github.com/users/libuv/gists{/gist_id}","starred_url":"https://api.github.com/users/libuv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libuv/subscriptions","organizations_url":"https://api.github.com/users/libuv/orgs","repos_url":"https://api.github.com/users/libuv/repos","events_url":"https://api.github.com/users/libuv/events{/privacy}","received_events_url":"https://api.github.com/users/libuv/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/libuv/libuv","description":"Cross-platform asychronous I/O","fork":false,"url":"https://api.github.com/repos/libuv/libuv","forks_url":"https://api.github.com/repos/libuv/libuv/forks","keys_url":"https://api.github.com/repos/libuv/libuv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/libuv/libuv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/libuv/libuv/teams","hooks_url":"https://api.github.com/repos/libuv/libuv/hooks","issue_events_url":"https://api.github.com/repos/libuv/libuv/issues/events{/number}","events_url":"https://api.github.com/repos/libuv/libuv/events","assignees_url":"https://api.github.com/repos/libuv/libuv/assignees{/user}","branches_url":"https://api.github.com/repos/libuv/libuv/branches{/branch}","tags_url":"https://api.github.com/repos/libuv/libuv/tags","blobs_url":"https://api.github.com/repos/libuv/libuv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/libuv/libuv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/libuv/libuv/git/refs{/sha}","trees_url":"https://api.github.com/repos/libuv/libuv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/libuv/libuv/statuses/{sha}","languages_url":"https://api.github.com/repos/libuv/libuv/languages","stargazers_url":"https://api.github.com/repos/libuv/libuv/stargazers","contributors_url":"https://api.github.com/repos/libuv/libuv/contributors","subscribers_url":"https://api.github.com/repos/libuv/libuv/subscribers","subscription_url":"https://api.github.com/repos/libuv/libuv/subscription","commits_url":"https://api.github.com/repos/libuv/libuv/commits{/sha}","git_commits_url":"https://api.github.com/repos/libuv/libuv/git/commits{/sha}","comments_url":"https://api.github.com/repos/libuv/libuv/comments{/number}","issue_comment_url":"https://api.github.com/repos/libuv/libuv/issues/comments/{number}","contents_url":"https://api.github.com/repos/libuv/libuv/contents/{+path}","compare_url":"https://api.github.com/repos/libuv/libuv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/libuv/libuv/merges","archive_url":"https://api.github.com/repos/libuv/libuv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/libuv/libuv/downloads","issues_url":"https://api.github.com/repos/libuv/libuv/issues{/number}","pulls_url":"https://api.github.com/repos/libuv/libuv/pulls{/number}","milestones_url":"https://api.github.com/repos/libuv/libuv/milestones{/number}","notifications_url":"https://api.github.com/repos/libuv/libuv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/libuv/libuv/labels{/name}","releases_url":"https://api.github.com/repos/libuv/libuv/releases{/id}","created_at":"2013-11-30T00:29:56Z","updated_at":"2015-02-03T18:16:31Z","pushed_at":"2015-02-02T08:49:52Z","git_url":"git://github.com/libuv/libuv.git","ssh_url":"git@github.com:libuv/libuv.git","clone_url":"https://github.com/libuv/libuv.git","svn_url":"https://github.com/libuv/libuv","homepage":"http://libuv.org/","size":16269,"stargazers_count":850,"watchers_count":850,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":27,"mirror_url":null,"open_issues_count":30,"forks":27,"open_issues":30,"watchers":850,"default_branch":"v1.x"}},"_links":{"self":{"href":"https://api.github.com/repos/libuv/libuv/pulls/178"},"html":{"href":"https://github.com/libuv/libuv/pull/178"},"issue":{"href":"https://api.github.com/repos/libuv/libuv/issues/178"},"comments":{"href":"https://api.github.com/repos/libuv/libuv/issues/178/comments"},"review_comments":{"href":"https://api.github.com/repos/libuv/libuv/pulls/178/comments"},"review_comment":{"href":"https://api.github.com/repos/libuv/libuv/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/libuv/libuv/pulls/178/commits"},"statuses":{"href":"https://api.github.com/repos/libuv/libuv/statuses/f7e02c6098992dd59b19abb4c88e5f1722bd8e2f"}}}}