Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. HeapAlloc bombing

HeapAlloc bombing

Scheduled Pinned Locked Moved C / C++ / MFC
data-structuresquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TimWallace
    wrote on last edited by
    #1

    I have a weird one, here. I have a class that uses a linked list of pointers to another class (ie. a mbr var that has a pointer to the next object). In my processing, I loop to create the necessary instances of the "outside" class. As part of the constructor of that object, the linked list is built by calling new inside of a loop. The first "outside" object is created flawlessly. When the second "outside" object is created, while the first mbr of the linked list is being created, HeapAlloc bombs out. Does anyone have any clues on what this could be? I tried wrapping the "obj = new objclass" in a try/catch(...), but nothing is caught. I'm at my wit's end on this one.

    R T 2 Replies Last reply
    0
    • T TimWallace

      I have a weird one, here. I have a class that uses a linked list of pointers to another class (ie. a mbr var that has a pointer to the next object). In my processing, I loop to create the necessary instances of the "outside" class. As part of the constructor of that object, the linked list is built by calling new inside of a loop. The first "outside" object is created flawlessly. When the second "outside" object is created, while the first mbr of the linked list is being created, HeapAlloc bombs out. Does anyone have any clues on what this could be? I tried wrapping the "obj = new objclass" in a try/catch(...), but nothing is caught. I'm at my wit's end on this one.

      R Offline
      R Offline
      Ravi Bhavnani
      wrote on last edited by
      #2

      Recursive memory alloc, perhaps? A TRACE() statement in a constructor or two might identify this if it's the problem. /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com

      1 Reply Last reply
      0
      • T TimWallace

        I have a weird one, here. I have a class that uses a linked list of pointers to another class (ie. a mbr var that has a pointer to the next object). In my processing, I loop to create the necessary instances of the "outside" class. As part of the constructor of that object, the linked list is built by calling new inside of a loop. The first "outside" object is created flawlessly. When the second "outside" object is created, while the first mbr of the linked list is being created, HeapAlloc bombs out. Does anyone have any clues on what this could be? I tried wrapping the "obj = new objclass" in a try/catch(...), but nothing is caught. I'm at my wit's end on this one.

        T Offline
        T Offline
        TimWallace
        wrote on last edited by
        #3

        It took me going home last night and clearing my head. When I came in today, I started walking through all the memory allocation in that process. I found a copy/paste error that was corrupting the heap.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups