1 Document omalloc memory allocator design and usage by BrentBaccala · Pull Request #1347 · Singular/Singular · GitHub
Skip to content

Document omalloc memory allocator design and usage#1347

Open
BrentBaccala wants to merge 1 commit intoSingular:spielwiesefrom
BrentBaccala:omalloc-readme
Open

Document omalloc memory allocator design and usage#1347
BrentBaccala wants to merge 1 commit intoSingular:spielwiesefrom
BrentBaccala:omalloc-readme

Conversation

@BrentBaccala
Copy link
Copy Markdown
Contributor

Summary

  • Write comprehensive README for omalloc explaining the allocator design for developers unfamiliar with the codebase
  • Covers bins, pages, page regions, sticky bins (both omGetStickyBinOfBin and the unused tag-based mechanism), spec bins, static bins
  • Documents API layers (omAllocDecl.h, omBin.h, omDebug.h), build configuration (--disable-omalloc, XALLOC_BIN, --enable-debug), and thread safety
  • Explains integration with Singular's Groebner basis engine (PolyBin, tailBin, lmBin, kStratChangeTailRing lifecycle)

Test plan

  • Verify README renders correctly as plain text (no markdown formatting used)
  • Review technical accuracy against source code

This PR was researched and written by an AI assistant (Claude) on behalf of Brent Baccala (cosine@freesoft.org), based on source code analysis of the omalloc implementation.

Write comprehensive documentation for omalloc covering: bin-based
allocation design, page management, page regions, the two sticky bin
mechanisms (tag-based and omGetStickyBinOfBin), spec bins, static bins,
the public API layers, debug/check facilities, build configuration
(--disable-omalloc, XALLOC_BIN, OM_NDEBUG), thread safety analysis,
and integration with Singular's Groebner basis engine (PolyBin,
tailBin, lmBin, kStratChangeTailRing lifecycle).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@BrentBaccala
Copy link
Copy Markdown
Contributor Author

There's been an empty omalloc/README file since 1998. I was trying to figure out omalloc, so I had Claude fill in the file. I looked it over; it seems fine, but remember - I did this because I was trying to learn how omalloc works, not because I already knew...

@jankoboehm
Copy link
Copy Markdown
Member

Thanks a lot, this is very useful indeed! If it is ok with you I will check out the PR and make another round of tweaks to the file before we merge.

@BrentBaccala
Copy link
Copy Markdown
Contributor Author

Another round of tweaks is welcome, as I don't really know much about omalloc myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants