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. how to free memory space for 2 dimension ?

how to free memory space for 2 dimension ?

Scheduled Pinned Locked Moved C / C++ / MFC
performancetutorialquestion
3 Posts 3 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.
  • M Offline
    M Offline
    mybm1
    wrote on last edited by
    #1

    float **deviation1;
    deviation1=memory_alloc_2D(waveframesize,NUM_OF_COEFFICIENTS);

    for(i=0;i

    I am trying to free the memory space of deviation but it seem not working cause the process is killed and while checking the running process for every loop the memory size is incremented..can someone suggest where i wen wrong?

    J A 2 Replies Last reply
    0
    • M mybm1

      float **deviation1;
      deviation1=memory_alloc_2D(waveframesize,NUM_OF_COEFFICIENTS);

      for(i=0;i

      I am trying to free the memory space of deviation but it seem not working cause the process is killed and while checking the running process for every loop the memory size is incremented..can someone suggest where i wen wrong?

      J Offline
      J Offline
      Jochen Arndt
      wrote on last edited by
      #2

      You should show us the source of your memory_alloc_2D function. In general it is better to free the most recently allocated memory first. That means the loop in your freeArray function should start at m-1 and decrement the loop variable until null.

      1 Reply Last reply
      0
      • M mybm1

        float **deviation1;
        deviation1=memory_alloc_2D(waveframesize,NUM_OF_COEFFICIENTS);

        for(i=0;i

        I am trying to free the memory space of deviation but it seem not working cause the process is killed and while checking the running process for every loop the memory size is incremented..can someone suggest where i wen wrong?

        A Offline
        A Offline
        Albert Holguin
        wrote on last edited by
        #3

        mybm1 wrote:

        memory_alloc_2D

        This is not a standard call... which usually means you shouldn't use a standard call to free the allocation. If this is from a library that you're using, it likely also has a corresponding "free_2D" call (guessing on the name).

        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