{"action":"created","issue":{"url":"https://api.github.com/repos/akheron/jansson/issues/225","labels_url":"https://api.github.com/repos/akheron/jansson/issues/225/labels{/name}","comments_url":"https://api.github.com/repos/akheron/jansson/issues/225/comments","events_url":"https://api.github.com/repos/akheron/jansson/issues/225/events","html_url":"https://github.com/akheron/jansson/issues/225","id":59920697,"number":225,"title":"More flexible custom memory allocation","user":{"login":"claudix","id":5880835,"avatar_url":"https://avatars.githubusercontent.com/u/5880835?v=3","gravatar_id":"","url":"https://api.github.com/users/claudix","html_url":"https://github.com/claudix","followers_url":"https://api.github.com/users/claudix/followers","following_url":"https://api.github.com/users/claudix/following{/other_user}","gists_url":"https://api.github.com/users/claudix/gists{/gist_id}","starred_url":"https://api.github.com/users/claudix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/claudix/subscriptions","organizations_url":"https://api.github.com/users/claudix/orgs","repos_url":"https://api.github.com/users/claudix/repos","events_url":"https://api.github.com/users/claudix/events{/privacy}","received_events_url":"https://api.github.com/users/claudix/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-05T08:35:12Z","updated_at":"2015-03-05T10:18:54Z","closed_at":null,"body":"It'd be interesting to pass a user argument to custom allocation functions. For example:\r\n\r\n```c\r\nvoid *my_malloc(size_t sz, void *userarg)\r\n{\r\n...   \r\n}\r\n\r\nvoid my_free(void *p, void *userarg)\r\n{\r\n...\r\n}\r\n\r\nfoo_t myarg;\r\njson_set_alloc_funcs_arg(my_malloc, my_free, &myarg); //<---The wanted function\r\n```\r\n\r\nThis way the custom functions would receive 'myarg' every time they were called. This is useful when using memory pool allocators such as [Apache's mempools](http://apr.apache.org/docs/apr/1.2/group__apr__pools.html).\r\n\r\nThank you.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/akheron/jansson/issues/comments/77339359","html_url":"https://github.com/akheron/jansson/issues/225#issuecomment-77339359","issue_url":"https://api.github.com/repos/akheron/jansson/issues/225","id":77339359,"user":{"login":"claudix","id":5880835,"avatar_url":"https://avatars.githubusercontent.com/u/5880835?v=3","gravatar_id":"","url":"https://api.github.com/users/claudix","html_url":"https://github.com/claudix","followers_url":"https://api.github.com/users/claudix/followers","following_url":"https://api.github.com/users/claudix/following{/other_user}","gists_url":"https://api.github.com/users/claudix/gists{/gist_id}","starred_url":"https://api.github.com/users/claudix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/claudix/subscriptions","organizations_url":"https://api.github.com/users/claudix/orgs","repos_url":"https://api.github.com/users/claudix/repos","events_url":"https://api.github.com/users/claudix/events{/privacy}","received_events_url":"https://api.github.com/users/claudix/received_events","type":"User","site_admin":false},"created_at":"2015-03-05T10:18:54Z","updated_at":"2015-03-05T10:18:54Z","body":"I have submitted a pull request: [https://github.com/akheron/jansson/pull/226](https://github.com/akheron/jansson/pull/226)"}}