Skip to main content
GameDev.net gamedev.net
🔒 Locked

malloc and free

Started by Assembler015 Nov 2, 2002 at 3:56 PM 13 replies 250+ views
Original Post
Assembler015
Assembler015
Hey everyone - I''ve been thinking this over carefuly and since I don''t play many DOS games any more and I don''t care to see the BIOS boot up screen in good ''ol VGA resolutions that use the address space 0xA000->0xC000 I made my decision. I wish to get rid of these addresses in memory because they are just taking up space and "cluttering" up my computer. So I decided to use free(0xA000)->free(0xC000) to permanently delete them but every time I try that windows BSOD''s on me. Once I get that done, I wish to make some more memory on my computer. However, everytime I try malloc(0xFFFFFFFF) to allocate and extra 4 gig of RAM it fails. Can anyone help me out here? Thanks --Andrew
Run_The_Shadows
Run_The_Shadows
Roofle.

-Ryan "Run_The_Shadows"
-Run_The_Shadows@excite.com
-The Navidson Record! The best film you''ll never see!
Conner McCloud
Conner McCloud
You''re going about this all wrong. Obviously malloc and free aren''t going to work.

The first step is to go out and buy a few copies of your motherboard; there''s some tricky work, and if you mess up you''ll need a replacement and start over. Go over your mb''s specs, and figure out which bit of its ROM contains the data that is eventually moved into those areas you want to free up. Carefully slice those portions out, and replace them with an identical piece sliced out of one of the spare mother boards. Now, when you boot up, Windows won''t realize those areas are special, because they just contain junk data from some other part of the motherboard, so itll go ahead and use it when allocating memory.

As for the extra memory, you''ll have to go buy some new RAM. Then solder it onto the top of your old RAM, and you''ll be good to go. If you don''t know how, well, you''re out of luck. If you''re serious about creating a killer machine, it''ll be worth your time to learn.

CM
Nypyren
Nypyren
I think I literally LOL''ed!
Beer Hunter
Beer Hunter
You know you spend too much time on the internet when: You catch yourself about to actually say "LOL".
tuita
tuita
Isn''t 2GB the maximum you can get in User space? (3GB On Some OS).
Even if this is wrong, you couldn''t allocate 4GB because, if possible, it would overwrite the Kernel, Stack and Code Segments wouldn''t it?
elis-cool
elis-cool
Heh!
I actually thought this was real upto the line "malloc(0xFFFFFFFF)", and I had already begun gathering my thoughts of how I was going to flame you!!
[email=esheppard@gmail.com]esheppard@gmail.com[/email]
smart_idiot
smart_idiot
Maybe new and delete would work better?
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other
Paradigm Shifter
Paradigm Shifter
It only works on 32-bit machines.
I opened up my PC; it had a lot more than 32 bits inside it.

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley
"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley
smart_idiot
smart_idiot
Good point, why not go straight to the top and use the far superior new and delete?
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other
smart_idiot
smart_idiot
Another good tip for saving space on your harddrive is to use a folder as a filename, and in the folder have an empty files whos name is the contents of the file. You can store as much as you want this way without using up any space, I''m amazed nobody has thought of this sooner!
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other
Mithrandir
Mithrandir
Windows supports 4GB of addressible space.

There is also a patch for WindowsNT (I believe) and special motherboards that will allow you to use 36-bit addressing, thus allowing you to access up to 64GB of memory. Obviously, these are for servers.

I''m waiting for 64 bit addressing...

152,587 yottabytes...


that''s... around 17,000,000,000 (17 billion) Gigabytes!!!!



... 17 billion gigabytes ought to be enough for anybody!
(*waits 20 years for someone to prove him wrong*)
This is my signature. There are many like it, but this one is mine. My signature is my best friend. It is my life. I must master it as I must master my life. My signature, without me, is useless. Without my signature, I am useless.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.