-
February 16th, 2007, 04:48 PM
#16
Re: Modifying malloc( ) implementation, without changing malloc( ) source code
Hello,
Why don’t you override the global new operator?
ZDF
What is good is twice as good if it's simple.
"Make it simple" is a complex task.
-
February 16th, 2007, 04:49 PM
#17
Re: Modifying malloc( ) implementation, without changing malloc( ) source code
In the other thread he explained that he's doing this in C. My understanding is that he needs the system's heap manager to allocate a specific address range.
-
February 16th, 2007, 04:59 PM
#18
Re: Modifying malloc( ) implementation, without changing malloc( ) source code
Then, why not use #define?
Code:
#include <stdlib.h>
void* MyAlloc(size_t)
{
void* p;
// ...
return p;
}
#define malloc(s) MyAlloc(s)
int main()
{
void* p = malloc( 1 ); // MyAlloc will be called instead of stdlib malloc
return 0;
}
ZDF
What is good is twice as good if it's simple.
"Make it simple" is a complex task.
-
February 16th, 2007, 05:03 PM
#19
Re: Modifying malloc( ) implementation, without changing malloc( ) source code
It's the
that we are having a small problem with.
-
February 16th, 2007, 05:19 PM
#20
Re: Modifying malloc( ) implementation, without changing malloc( ) source code
As I posted in the other thread...
Code:
sometype *ptr = 0x040000;
If the address is sized, and no other resource is going to try to use it. Not enough information posted (in either thread) to know....
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
2008, 2009,2010
In theory, there is no difference between theory and practice; in practice there is.
* Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
* How NOT to post a question here
* Of course you read this carefully before you posted
* Need homework help? Read this first
-
February 16th, 2007, 05:36 PM
#21
Re: Modifying malloc( ) implementation, without changing malloc( ) source code
Originally Posted by TheCPUWizard
Not enough information posted (in either thread) to know....
Yeah, I agree, we don't even know if he is running inside Windows' virtual address space.
-
February 16th, 2007, 05:38 PM
#22
Re: Modifying malloc( ) implementation, without changing malloc( ) source code
Originally Posted by Zaccheus
It's the
that we are having a small problem with.
So... he needs a memory manager to manage the memory pool?... And this new manager must work better than the original one?
ZDF
What is good is twice as good if it's simple.
"Make it simple" is a complex task.
-
February 16th, 2007, 06:00 PM
#23
Re: Modifying malloc( ) implementation, without changing malloc( ) source code
I think he wants to allocate memory at a specific address, which is why I suggested VirtualAlloc, but it's really not very clear whether that function is what is needed.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|