{"action":"created","issue":{"url":"https://api.github.com/repos/libuv/libuv/issues/231","labels_url":"https://api.github.com/repos/libuv/libuv/issues/231/labels{/name}","comments_url":"https://api.github.com/repos/libuv/libuv/issues/231/comments","events_url":"https://api.github.com/repos/libuv/libuv/issues/231/events","html_url":"https://github.com/libuv/libuv/pull/231","id":59159712,"number":231,"title":"memory: add uv_replace_allocator","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},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-26T23:05:16Z","updated_at":"2015-02-27T16:25:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/libuv/libuv/pulls/231","html_url":"https://github.com/libuv/libuv/pull/231","diff_url":"https://github.com/libuv/libuv/pull/231.diff","patch_url":"https://github.com/libuv/libuv/pull/231.patch"},"body":"With uv_replace_allocator, it's possible to override the default\r\nmemory allocator's malloc and free calls with functions of the user's\r\nchoosing. This allows libuv to interoperate with projects requiring a\r\ncustom memory allocator.\r\n\r\nInternally, all calls to malloc and free have been replaced with\r\nuv__malloc and uv__free, respectively. The uv__malloc and uv__free\r\nfunctions call malloc and free unless they have been overridden by a\r\nprevious call to uv_replace_allocator.\r\n\r\nAs part of this change, the special aligned memory allocations\r\nperformed in src/win/fs-event.c has been replaced with standard\r\nallocations. The 4-byte alignment being requested in this file was\r\nunnecessary, since standard allocators already guarantee at least an\r\n8-byte alignment."},"comment":{"url":"https://api.github.com/repos/libuv/libuv/issues/comments/76422523","html_url":"https://github.com/libuv/libuv/pull/231#issuecomment-76422523","issue_url":"https://api.github.com/repos/libuv/libuv/issues/231","id":76422523,"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},"created_at":"2015-02-27T16:25:36Z","updated_at":"2015-02-27T16:25:36Z","body":"I've updated the documentation and uv.h.  If you think it looks good, I'll squash the 2 commits (and rebase if necessary).\r\n\r\nThanks for your patience and help."}}