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 8179687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:03:24+00:00 2026-06-07T00:03:24+00:00

I am using Doug Lea’s dlmalloc memory allocator . However I get segmentation when

  • 0

I am using Doug Lea’s dlmalloc memory allocator. However I get segmentation when I use that. If I use the normal malloc my program runs fine. I remember I once read that you need to first call some initialization function for dlmalloc to work, but I can’t remember now which function. I have tried to look at the comments to figure out which function, but still can’t find it.

  • 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-06-07T00:03:25+00:00Added an answer on June 7, 2026 at 12:03 am

    From the comments in the source code of the allocator:

    Tread-safety: NOT thread-safe unless USE_LOCKS defined non-zero

    When USE_LOCKS is defined, each public call to malloc, free, etc is surrounded with a lock. By default, this uses a plain pthread mutex, win32 critical section, or a spin-lock if if available for the platform and not disabled by setting USE_SPIN_LOCKS=0.

    You need to compile the library with USE_LOCKS, otherwise you may see crashes.

    Another possibility is that your program exhibits undefined behavior that does not lead to consequences with the regular malloc. For example, it might write one byte past the allocated area somewhere, but that byte could be part of a memory chunk that is a few bytes larger than what you have requested. Use valgrind to check your program for memory errors with "regular" malloc before linking it with the custom allocator.

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

Sidebar

Related Questions

We have been using Doug Lea's concurrent library for more than 8 years now.
Using ThreadPoolRuntime, I could get a throughput attiribute that means The mean number of
I'm using a Google Analytics API Class in PHP made by Doug Tan to
Using the Redis info command, I am able to get all the stats of
Using Location.getBearing(); I seem to get randomly changing bearings. Aka, I can turn the
I have been using Doug Hellmann's script to back up my repo for 2
We have a table that converts SAT scores into ACT scores using a year.
I've written a c/c++ memory manager for heap allocations (overloaded new/delete and malloc/realloc/free, based
Using report builder 3.0, I have a report that queries a cube. How do
Using Entity Framework CodeFirst, how do I create a created datetime column that gets

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.