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. Changing the Default CRT Heap

Changing the Default CRT Heap

Scheduled Pinned Locked Moved C / C++ / MFC
jsonperformance
2 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.
  • P Offline
    P Offline
    Paul M Watt
    wrote on last edited by
    #1

    Hi all, I was wondering if anyone knew of a way to change the default C-runtime heap for a DLL. I would like a DLL that I am creating to automatically allocate its data into a different heap than the host process, and I dont really want to resort to writing my own heap manager or using the Win32 heap functions to manage memory. Thanks


    Build a man a fire, and he will be warm for a day
    Light a man on fire, and he will be warm for the rest of his life!

    G 1 Reply Last reply
    0
    • P Paul M Watt

      Hi all, I was wondering if anyone knew of a way to change the default C-runtime heap for a DLL. I would like a DLL that I am creating to automatically allocate its data into a different heap than the host process, and I dont really want to resort to writing my own heap manager or using the Win32 heap functions to manage memory. Thanks


      Build a man a fire, and he will be warm for a day
      Light a man on fire, and he will be warm for the rest of his life!

      G Offline
      G Offline
      geo_m
      wrote on last edited by
      #2

      Correct me if I am wrong, but I always thought, that the dlls have they own heap - therefore if you malloc something in DLL you are not able to free it in the EXE (or another DLL). I am not really sure about that, but it was told me in some years ago, while learning working with DLLs I allocated some resource in DLL1 and tried to free it in DLL2, getting the heap corruption message.

      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