Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6324949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:48:10+00:00 2026-05-24T16:48:10+00:00

I am looking for a good memory pool implementation in C. it should include

  • 0

I am looking for a good memory pool implementation in C.

it should include the following:

  1. Anti fragmentation.
  2. Be super fast 🙂
  3. Ability to “bundle” several allocations from different sizes under some identifier and delete all the allocations with the given identifier.
  4. Thread safe
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T16:48:11+00:00Added an answer on May 24, 2026 at 4:48 pm

    I think the excellent talloc, developed as part of samba might be what you’re looking for. The part I find most interesting is that any pointer returned from talloc is a valid memory context. Their example is:

    struct foo *X = talloc(mem_ctx, struct foo);
    X->name = talloc_strdup(X, "foo");
    // ...
    talloc_free(X); // frees memory for both X and X->name
    

    In response to your particular points:

    (1) Not sure what anti-fragmentation is in this case. In C you’re not going to get compacting garbage collection anyway, so I think your choices are somewhat limited.

    (2) It advertises being only 4% slower than plain malloc(3), which is quite fast.

    (3) See example above.

    (4) It is thread safe as long as different threads use different contexts & the underlying malloc is thread safe.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently looking for a good memory / leak detection tool for Windows. A
I'm looking for a good JavaScript Memory profiler, specifically one that targets IE. And
I'm looking for some good code examples of dynamic memory allocation using an assembly
Looking for good project methodologies.Anyone got some good reference links..want to share.
I am looking for good methods of manipulating HTML in PHP. For example, the
I am looking for good templates for writing both technical and functional specs on
I'm looking for good/working/simple to use PHP code for parsing raw email into parts.
I am looking for good ideas for implementing a generic way to have a
I'm looking for good patterns for implementing a paged table of results in ASP.NET
I am looking for good beginners material on Prolog, both online and printed. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.