Pascal

Moderators: None (Apply to moderate this forum)
Number of threads: 4095
Number of posts: 14004

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
MEMORY Posted by bpajk on 8 Apr 2003 at 2:34 PM
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.

Report
Re: MEMORY Posted by tron on 8 Apr 2003 at 9:21 PM
: 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.
Report
Re: MEMORY Posted by zibadian on 8 Apr 2003 at 9:49 PM
: : 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.
Report
Re: MEMORY Posted by bpajk on 9 Apr 2003 at 2:46 PM
: : : 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!


Report
Re: MEMORY Posted by Phat Nat on 10 Apr 2003 at 2:26 PM
: : 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

Phat Nat



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.