Announcement

Collapse
No announcement yet.

MemoryAllocating

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • MemoryAllocating

    Hey,

    How can I dynamic allocate memory in my application like others
    language because they have statements for reserving dynamic memory
    allocating.
    Is there here a goud functions on the forums like
    CreateMem, MemAlloc
    FreeMem

    Mvgr

    ------------------

  • #2
    you've asked for this thing before and i gave you some code that does this. here's the url to the archived message:

    http://www.powerbasic.com/support/pb...read.php?t=321


    ------------------

    Comment


    • #3
      cf DIM, REDIM, SPACE$, STRING$, and the Windows API calls, GlobalAlloc, LocalAlloc,
      HeapAlloc, undsoweiter. We (still) have this item on the wish list, but it seems a
      bit redundant, as do repeated requests by the same person for this functionality.


      ------------------
      Tom Hanlin
      PowerBASIC Staff

      Comment


      • #4
        Thanks
        Is that code works fine for PBDOS, PBCC?

        ------------------

        Comment


        • #5
          The code I posted only works for PB/DOS. For PB/CC, as was mentioned, there are win32 api calls that can do this. I don't program or even use windows, so I can't tell you what they are.

          ------------------

          Comment


          • #6
            Can you tell my what api4S CAN i use

            ------------------

            Comment


            • #7
              From the Win32API help file provided by PB:

              Following are the Win32 functions used in memory management.

              CopyMemory
              FillMemory
              GetProcessHeap
              GetProcessHeaps
              GlobalAlloc
              GlobalDiscard
              GlobalFlags
              GlobalFree
              GlobalHandle
              GlobalLock
              GlobalMemoryStatus
              GlobalReAlloc
              GlobalSize
              GlobalUnlock
              HeapAlloc
              HeapCompact
              HeapCreate
              HeapDestroy
              HeapFree
              HeapLock
              HeapReAlloc
              HeapSize
              HeapUnlock
              HeapValidate
              IsBadCodePtr
              IsBadHugeReadPtr
              IsBadHugeWritePtr
              IsBadReadPtr
              IsBadStringPtr
              IsBadWritePtr
              LocalAlloc
              LocalDiscard
              LocalFlags
              LocalFree
              LocalHandle
              LocalLock
              LocalReAlloc
              LocalSize
              LocalUnlock
              MoveMemory
              VirtualAlloc
              VirtualFree
              VirtualLock
              VirtualProtect
              VirtualProtectEx
              VirtualQuery
              VirtualQueryEx
              VirtualUnlock
              ZeroMemory
              That's 49 functions. If you master one per business day (five business days per business week) you should be ready to ask again approximately in 9 weeks, 4 days, which puts us about June 1, 2001.


              MCM


              ------------------
              Michael Mattias
              Racine WI USA
              [email protected]
              Michael Mattias
              Tal Systems Inc. (retired)
              Racine WI USA
              [email protected]
              http://www.talsystems.com

              Comment

              Working...
              X