Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

MEMORY

bpajkbpajk Posts: 156Member
How can I allocate more then 64 kB of heap. I want to save the screen into the memory with pointers. I am using Turbo Pascal 7. I have 320 MB of RAM. I don't think that should be a problem. How would I overcome this problem. Thank you in advance.

Comments

  • : How can I allocate more then 64 kB of heap. I want to save the screen into the memory with pointers. I am using Turbo Pascal 7. I have 320 MB of RAM. I don't think that should be a problem. How would I overcome this problem. Thank you in advance.
    :
    :

    The heap is not limited to 64kB - however, because TP runs under DOS, data blocks are limited to 64kB. You can overcome this by using multiple data blocks and save your screen segmented (search the help for the "getmem" function, if you aren't already using it).

    As mentioned above, TP is DOS based, which means that you only can use the first MB of your memory (this is because of the SEGMENT:OFFSET memory access type in RealMode/DOSMode). You can access the rest of your memory by using dos-extenders.
    I suggest using the XMS-Extender is a pretty good way - I had figured out that this is much easier than EMM. If your heap is not big enough for what you are trying to do, then search the web for a XMS-unit/tutorial, there are plenty of 'em out there.

    hope that helped,
    tron.
  • zibadianzibadian Posts: 6,349Member
    : : How can I allocate more then 64 kB of heap. I want to save the screen into the memory with pointers. I am using Turbo Pascal 7. I have 320 MB of RAM. I don't think that should be a problem. How would I overcome this problem. Thank you in advance.
    : :
    : :
    :
    : The heap is not limited to 64kB - however, because TP runs under DOS, data blocks are limited to 64kB. You can overcome this by using multiple data blocks and save your screen segmented (search the help for the "getmem" function, if you aren't already using it).
    :
    : As mentioned above, TP is DOS based, which means that you only can use the first MB of your memory (this is because of the SEGMENT:OFFSET memory access type in RealMode/DOSMode). You can access the rest of your memory by using dos-extenders.
    : I suggest using the XMS-Extender is a pretty good way - I had figured out that this is much easier than EMM. If your heap is not big enough for what you are trying to do, then search the web for a XMS-unit/tutorial, there are plenty of 'em out there.
    :
    : hope that helped,
    : tron.
    :
    You could also use the TEMSStream object. I've often created a descendant of that object, which treated the data as an array of records. This way you only have to worry about the memory-management once, and then it is simply a matter of using an array. There is only 1 restriction to this object: it can only handle the first 16 MB.
  • bpajkbpajk Posts: 156Member
    : : : How can I allocate more then 64 kB of heap. I want to save the screen into the memory with pointers. I am using Turbo Pascal 7. I have 320 MB of RAM. I don't think that should be a problem. How would I overcome this problem. Thank you in advance.
    : : :
    : : :
    : :
    : : The heap is not limited to 64kB - however, because TP runs under DOS, data blocks are limited to 64kB. You can overcome this by using multiple data blocks and save your screen segmented (search the help for the "getmem" function, if you aren't already using it).
    : :
    : : As mentioned above, TP is DOS based, which means that you only can use the first MB of your memory (this is because of the SEGMENT:OFFSET memory access type in RealMode/DOSMode). You can access the rest of your memory by using dos-extenders.
    : : I suggest using the XMS-Extender is a pretty good way - I had figured out that this is much easier than EMM. If your heap is not big enough for what you are trying to do, then search the web for a XMS-unit/tutorial, there are plenty of 'em out there.
    : :
    : : hope that helped,
    : : tron.
    : :
    : You could also use the TEMSStream object. I've often created a descendant of that object, which treated the data as an array of records. This way you only have to worry about the memory-management once, and then it is simply a matter of using an array. There is only 1 restriction to this object: it can only handle the first 16 MB.
    :
    Thanx guys!


  • Phat NatPhat Nat Posts: 757Member
    : : You could also use the TEMSStream object. I've often created a descendant of that object, which treated the data as an array of records. This way you only have to worry about the memory-management once, and then it is simply a matter of using an array. There is only 1 restriction to this object: it can only handle the first 16 MB.
    : :
    : Thanx guys!


    I just started learning XMS about 1-2 weeks ago. It is very easy to understand. Allows massive memory allocation. I have the unit at home that I found that I will post the next time I have a minute to stop for a breath :-o

    Phat Nat
Sign In or Register to comment.