René's URL Explorer Experiment


Title: Custom memory allocators by pks-t · Pull Request #4576 · libgit2/libgit2 · GitHub

Open Graph Title: Custom memory allocators by pks-t · Pull Request #4576 · libgit2/libgit2

X Title: Custom memory allocators by pks-t · Pull Request #4576 · libgit2/libgit2

Description: This is an RFC regarding custom memory allocators. Existing standard allocators are being renamed to git__stdalloc__. By default, our usual allocators git__ are being defined to git__stdalloc__. For CRTDBG, our allocators git__ are being defined to git__crtdbg__. If the CMake option "PLUGGABLE_ALLOCATORS" is set, we use an indirection. Instead of using typedefs, each of our allocator functions is not a define but instead a function pointer, which is by default set to the respecfive git__stdalloc__ function. Our git_libgit2_opts function is extended by "GIT_OPT_SET_ALLOCATOR, which receives as argument a git_allocator structure. Its members will then be used to change the function pointers. I don't know whether we really need to distinguish between builds with and without pluggable allocators. The question is whether there's a performance hit when using function pointers. I haven't measured that yet, though. The other thing I'm unhappy about is the CRTDBG stuff. It would be rather cool if we could allow users of libgit2 to swap in CRTDBG at runtime, in contrast to how we do it at compile time right now. It would also easily be possible, except for the fact that all CRTDBG functions have two additional parameters to create the correct trace: LINE and FILE. We could just extend all our allocators by these parameters. But this could again have a performance penalty, I guess. Again, this needs to be measured. Anyway. I first want your opinions on these points. The implementation would still need a bit of cleanup. The git_allocator stuff should probably be its own module "alloc.{c,h}", but that's minor stuff only.

Open Graph Description: This is an RFC regarding custom memory allocators. Existing standard allocators are being renamed to git__stdalloc__<fn>. By default, our usual allocators git__<fn> are being defined to...

X Description: This is an RFC regarding custom memory allocators. Existing standard allocators are being renamed to git__stdalloc__&lt;fn&gt;. By default, our usual allocators git__&lt;fn&gt; are ...

Opengraph URL: https://github.com/libgit2/libgit2/pull/4576

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:3c5edd87-e014-d61a-96b8-33b7c1387735
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE9B8:300F93:53D0458:6FDB3FC:6A5DCB5B
html-safe-nonce713cbbe1de899a06a96dc5a4f013cde518089a674927df51808bc097e18e3717
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOUI4OjMwMEY5Mzo1M0QwNDU4OjZGREIzRkM6NkE1RENCNUIiLCJ2aXNpdG9yX2lkIjoiNTY5MDcyNzc5NTIwMDQ3ODA0MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac367ef4fdf7616867f6c6d800d78d49ed239e870e5d04ff547bc8a4611408c701
hovercard-subject-tagpull_request:174180566
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/libgit2/libgit2/pull/4576/files
twitter:imagehttps://avatars.githubusercontent.com/u/4056630?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/4056630?s=400&v=4
og:image:altThis is an RFC regarding custom memory allocators. Existing standard allocators are being renamed to git__stdalloc__<fn>. By default, our usual allocators git__<fn> are being defined to...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/libgit2/libgit2 git https://github.com/libgit2/libgit2.git
octolytics-dimension-user_id394745
octolytics-dimension-user_loginlibgit2
octolytics-dimension-repository_id901662
octolytics-dimension-repository_nwolibgit2/libgit2
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id901662
octolytics-dimension-repository_network_root_nwolibgit2/libgit2
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release9c975978430e9ad293956f2bbdaf153b1bd84a99
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/libgit2/libgit2/pull/4576/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Flibgit2%2Flibgit2%2Fpull%2F4576%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Flibgit2%2Flibgit2%2Fpull%2F4576%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=libgit2%2Flibgit2
Reloadhttps://github.com/libgit2/libgit2/pull/4576/files
Reloadhttps://github.com/libgit2/libgit2/pull/4576/files
Reloadhttps://github.com/libgit2/libgit2/pull/4576/files
Please reload this pagehttps://github.com/libgit2/libgit2/pull/4576/files
libgit2 https://github.com/libgit2
libgit2https://github.com/libgit2/libgit2
Notifications https://github.com/login?return_to=%2Flibgit2%2Flibgit2
Fork 2.6k https://github.com/login?return_to=%2Flibgit2%2Flibgit2
Star 10.5k https://github.com/login?return_to=%2Flibgit2%2Flibgit2
Code https://github.com/libgit2/libgit2
Issues 423 https://github.com/libgit2/libgit2/issues
Pull requests 108 https://github.com/libgit2/libgit2/pulls
Discussions https://github.com/libgit2/libgit2/discussions
Actions https://github.com/libgit2/libgit2/actions
Projects https://github.com/libgit2/libgit2/projects
Security and quality 9 https://github.com/libgit2/libgit2/security
Insights https://github.com/libgit2/libgit2/pulse
Code https://github.com/libgit2/libgit2
Issues https://github.com/libgit2/libgit2/issues
Pull requests https://github.com/libgit2/libgit2/pulls
Discussions https://github.com/libgit2/libgit2/discussions
Actions https://github.com/libgit2/libgit2/actions
Projects https://github.com/libgit2/libgit2/projects
Security and quality https://github.com/libgit2/libgit2/security
Insights https://github.com/libgit2/libgit2/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Flibgit2%2Flibgit2%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Flibgit2%2Flibgit2%2Fissues%2Fnew%2Fchoose
pks-thttps://github.com/pks-t
libgit2:masterhttps://github.com/libgit2/libgit2/tree/master
pks-t:pks/memory-allocatorhttps://github.com/pks-t/libgit2/tree/pks/memory-allocator
Conversation 15 https://github.com/libgit2/libgit2/pull/4576
Commits 8 https://github.com/libgit2/libgit2/pull/4576/commits
Checks 0 https://github.com/libgit2/libgit2/pull/4576/checks
Files changed https://github.com/libgit2/libgit2/pull/4576/files
Please reload this pagehttps://github.com/libgit2/libgit2/pull/4576/files
Custom memory allocators https://github.com/libgit2/libgit2/pull/4576/files#top
Show all changes 8 commits https://github.com/libgit2/libgit2/pull/4576/files
aab8f87 win32: crtdbg: internalize implementation of allocators pks-t Mar 14, 2018 https://github.com/libgit2/libgit2/pull/4576/commits/aab8f87bbab3def110c7cb43961f5b1fb5c5b642
496b0df win32: crtdbg: provide independent `free` function pks-t Mar 14, 2018 https://github.com/libgit2/libgit2/pull/4576/commits/496b0df2ca2a115d2e5a7099f2b8fd6d7409fcb2
c47f715 util: extract `stdalloc` allocator into its own module pks-t Mar 14, 2018 https://github.com/libgit2/libgit2/pull/4576/commits/c47f71551714006ee1aba26c49fdd1f187251da2
d2e996f util: extract allocators into its own "alloc.h" header pks-t Mar 14, 2018 https://github.com/libgit2/libgit2/pull/4576/commits/d2e996fa17c0c39afe32a703a88b5f1f7b256c1c
08b318c stdalloc: extend allocators by file and line pks-t Mar 14, 2018 https://github.com/libgit2/libgit2/pull/4576/commits/08b318c0645b27393a70c2289a65b949ea4b45ed
9865cd1 alloc: make memory allocators use function pointers pks-t Mar 20, 2018 https://github.com/libgit2/libgit2/pull/4576/commits/9865cd1696ac4a3f47991a9a1d79b17cef5edc89
74b7ddb settings: allow swapping out memory allocator pks-t Mar 16, 2018 https://github.com/libgit2/libgit2/pull/4576/commits/74b7ddbf333ee20a4b2bc7a0e7c3f7c2aa4fc590
0f6348f CHANGELOG.md: update changelog to mention custom memory allocators pks-t May 18, 2018 https://github.com/libgit2/libgit2/pull/4576/commits/0f6348f4ff306f82dd7fa557bfa50c4e687e211b
Clear filters https://github.com/libgit2/libgit2/pull/4576/files
Please reload this pagehttps://github.com/libgit2/libgit2/pull/4576/files
Please reload this pagehttps://github.com/libgit2/libgit2/pull/4576/files
CHANGELOG.md https://github.com/libgit2/libgit2/pull/4576/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed
common.h https://github.com/libgit2/libgit2/pull/4576/files#diff-cbd185f68effb163b1aed8d08658d9e7699c54a806340450f4d407dc5975b0c1
alloc.h https://github.com/libgit2/libgit2/pull/4576/files#diff-eca0b99cb288214b0e098f7dc8479496275a7738f5792b94548b54bb6a854d8c
alloc.c https://github.com/libgit2/libgit2/pull/4576/files#diff-4907ceb74ffbc48dc681461fd341de2e2080248c93548cb2fc226b85512a7b48
alloc.h https://github.com/libgit2/libgit2/pull/4576/files#diff-b16e6f36d236d6b2db7a75a9dab619c1f7829e8b6494e5f7c2a75eab00801360
global.c https://github.com/libgit2/libgit2/pull/4576/files#diff-af3fc9e625eda022737b706ea7bc9201030ec07fe7236cb7bb7a1ba4d23454c7
settings.c https://github.com/libgit2/libgit2/pull/4576/files#diff-b16b9fd7ad76f07b54dd144e7c9917d017b82ab74ee7cd0cba9f7c750e2c509a
stdalloc.c https://github.com/libgit2/libgit2/pull/4576/files#diff-7e846c3c5fb6222cbaa8e177777681a573cc63f3ae5ab1115484f21c2383874a
stdalloc.h https://github.com/libgit2/libgit2/pull/4576/files#diff-f4977a90fea7a568fcfa23db851e07e54b154acafb69a2a9e90008b800f2e1cd
util.h https://github.com/libgit2/libgit2/pull/4576/files#diff-40ab92941994ec9418dbb76ae46d5aef0e4cb8b034f2be2b31562bb9aca8070f
w32_crtdbg_stacktrace.c https://github.com/libgit2/libgit2/pull/4576/files#diff-8bb698c38a9fefeec7bcb14bad866144485c838fad69b93ac453c66645d67d04
w32_crtdbg_stacktrace.h https://github.com/libgit2/libgit2/pull/4576/files#diff-f10c24f714ec3e595fe7f531209b6f1a769ab3f962ed12c7605de6d98c1ee962
stacktrace.c https://github.com/libgit2/libgit2/pull/4576/files#diff-56e5d80cdf980321324795d1dacebed66c0a1d17c5f8fb1a867cca9d5c8596e5
CHANGELOG.mdhttps://github.com/libgit2/libgit2/pull/4576/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed
View file https://github.com/pks-t/libgit2/blob/0f6348f4ff306f82dd7fa557bfa50c4e687e211b/CHANGELOG.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/libgit2/libgit2/pull/4576/{{ revealButtonHref }}
https://github.com/libgit2/libgit2/pull/4576/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed
https://github.com/libgit2/libgit2/pull/4576/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed
include/git2/common.hhttps://github.com/libgit2/libgit2/pull/4576/files#diff-cbd185f68effb163b1aed8d08658d9e7699c54a806340450f4d407dc5975b0c1
View file https://github.com/pks-t/libgit2/blob/0f6348f4ff306f82dd7fa557bfa50c4e687e211b/include/git2/common.h
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/libgit2/libgit2/pull/4576/{{ revealButtonHref }}
https://github.com/libgit2/libgit2/pull/4576/files#diff-cbd185f68effb163b1aed8d08658d9e7699c54a806340450f4d407dc5975b0c1
https://github.com/libgit2/libgit2/pull/4576/files#diff-cbd185f68effb163b1aed8d08658d9e7699c54a806340450f4d407dc5975b0c1
https://github.com/libgit2/libgit2/pull/4576/files#diff-cbd185f68effb163b1aed8d08658d9e7699c54a806340450f4d407dc5975b0c1
https://github.com/libgit2/libgit2/pull/4576/files#diff-cbd185f68effb163b1aed8d08658d9e7699c54a806340450f4d407dc5975b0c1
include/git2/sys/alloc.hhttps://github.com/libgit2/libgit2/pull/4576/files#diff-eca0b99cb288214b0e098f7dc8479496275a7738f5792b94548b54bb6a854d8c
View file https://github.com/pks-t/libgit2/blob/0f6348f4ff306f82dd7fa557bfa50c4e687e211b/include/git2/sys/alloc.h
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/libgit2/libgit2/pull/4576/{{ revealButtonHref }}
src/alloc.chttps://github.com/libgit2/libgit2/pull/4576/files#diff-4907ceb74ffbc48dc681461fd341de2e2080248c93548cb2fc226b85512a7b48
View file https://github.com/pks-t/libgit2/blob/0f6348f4ff306f82dd7fa557bfa50c4e687e211b/src/alloc.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/libgit2/libgit2/pull/4576/{{ revealButtonHref }}
src/alloc.hhttps://github.com/libgit2/libgit2/pull/4576/files#diff-b16e6f36d236d6b2db7a75a9dab619c1f7829e8b6494e5f7c2a75eab00801360
View file https://github.com/pks-t/libgit2/blob/0f6348f4ff306f82dd7fa557bfa50c4e687e211b/src/alloc.h
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/libgit2/libgit2/pull/4576/{{ revealButtonHref }}
src/global.chttps://github.com/libgit2/libgit2/pull/4576/files#diff-af3fc9e625eda022737b706ea7bc9201030ec07fe7236cb7bb7a1ba4d23454c7
View file https://github.com/pks-t/libgit2/blob/0f6348f4ff306f82dd7fa557bfa50c4e687e211b/src/global.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/libgit2/libgit2/pull/4576/{{ revealButtonHref }}
https://github.com/libgit2/libgit2/pull/4576/files#diff-af3fc9e625eda022737b706ea7bc9201030ec07fe7236cb7bb7a1ba4d23454c7
https://github.com/libgit2/libgit2/pull/4576/files#diff-af3fc9e625eda022737b706ea7bc9201030ec07fe7236cb7bb7a1ba4d23454c7
https://github.com/libgit2/libgit2/pull/4576/files#diff-af3fc9e625eda022737b706ea7bc9201030ec07fe7236cb7bb7a1ba4d23454c7
https://github.com/libgit2/libgit2/pull/4576/files#diff-af3fc9e625eda022737b706ea7bc9201030ec07fe7236cb7bb7a1ba4d23454c7
src/settings.chttps://github.com/libgit2/libgit2/pull/4576/files#diff-b16b9fd7ad76f07b54dd144e7c9917d017b82ab74ee7cd0cba9f7c750e2c509a
View file https://github.com/pks-t/libgit2/blob/0f6348f4ff306f82dd7fa557bfa50c4e687e211b/src/settings.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/libgit2/libgit2/pull/4576/{{ revealButtonHref }}
https://github.com/libgit2/libgit2/pull/4576/files#diff-b16b9fd7ad76f07b54dd144e7c9917d017b82ab74ee7cd0cba9f7c750e2c509a
https://github.com/libgit2/libgit2/pull/4576/files#diff-b16b9fd7ad76f07b54dd144e7c9917d017b82ab74ee7cd0cba9f7c750e2c509a
https://github.com/libgit2/libgit2/pull/4576/files#diff-b16b9fd7ad76f07b54dd144e7c9917d017b82ab74ee7cd0cba9f7c750e2c509a
https://github.com/libgit2/libgit2/pull/4576/files#diff-b16b9fd7ad76f07b54dd144e7c9917d017b82ab74ee7cd0cba9f7c750e2c509a
src/stdalloc.chttps://github.com/libgit2/libgit2/pull/4576/files#diff-7e846c3c5fb6222cbaa8e177777681a573cc63f3ae5ab1115484f21c2383874a
View file https://github.com/pks-t/libgit2/blob/0f6348f4ff306f82dd7fa557bfa50c4e687e211b/src/stdalloc.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/libgit2/libgit2/pull/4576/{{ revealButtonHref }}
src/stdalloc.hhttps://github.com/libgit2/libgit2/pull/4576/files#diff-f4977a90fea7a568fcfa23db851e07e54b154acafb69a2a9e90008b800f2e1cd
View file https://github.com/pks-t/libgit2/blob/0f6348f4ff306f82dd7fa557bfa50c4e687e211b/src/stdalloc.h
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/libgit2/libgit2/pull/4576/{{ revealButtonHref }}
Please reload this pagehttps://github.com/libgit2/libgit2/pull/4576/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.