Platform independent memory management library? 
Author Message
 Platform independent memory management library?

Is there such a thing?

Thanks in advance,
Jeroen



Sun, 25 Sep 2005 21:16:25 GMT  
 Platform independent memory management library?

Quote:

> Is there such a thing?

    Not really.  At some level, memory must be ultimately allocated from the
operating system, in a platform-specific manner.
--
Truth,
James Curran
www.noveltheory.com (personal)
www.njtheater.com (professional)


Sun, 25 Sep 2005 22:27:25 GMT  
 Platform independent memory management library?

Quote:

> > Is there such a thing?

>     Not really.  At some level, memory must be ultimately allocated from
the
> operating system, in a platform-specific manner.
> --

That's true!
It's really not that much of a problem since I can code a small platform
independent lib myself based on the functionality I need. But it would be
nice of a standard portable lib would exist.

Jeroen



Mon, 26 Sep 2005 15:47:26 GMT  
 Platform independent memory management library?

Quote:
> JV [Wed, 9 Apr 2003 15:16:25 +0200]:
>  >Is there such a thing?

> Sure, malloc or calloc or that cryptic new thing.

> --
>  40th Floor - Software

Ok I know, btw what cryptic new thing?
I need some more advanced memory management API's.
Using virtual memory support directly. In my case I need to allocate memory
at a multiple of 4kb boundary.
That's hard to do using malloc without spilling lots of physical memory
(actually the os should be able to cope with this by flushing the unused
pages to swap file when physical memory runs out, but it's not a nice
solution).
For now I'm using (Win32 only) VirtualAlloc().

Jeroen



Mon, 26 Sep 2005 15:55:12 GMT  
 Platform independent memory management library?

Quote:

> Ok I know, btw what cryptic new thing?

The not-so-cryptic "new" operator :-)

Quote:
> I need some more advanced memory management API's.
> Using virtual memory support directly. In my case I need to allocate memory
> at a multiple of 4kb boundary.

Why do you "need" to do that, for what purpose?

Quote:
> That's hard to do using malloc without spilling lots of physical memory

Why do you say so? The only difference is that malloc will (perhaps)
allocate larger chunks of memory, but it will do it less often.

Arnaud
MVP - VC



Tue, 27 Sep 2005 01:19:40 GMT  
 Platform independent memory management library?
are you looking for something more portable than

#ifdef UNIX
  sbrk()/mmap()
#elsif WINNT32
  VirtualAlloc()
#else
  #pragma error
#endif

to modify the address space of your process ?
I guess that changing the shape of the address space
is a pretty OS-dependent concept not easily portable.

All the Windows-based allocator I known are based on some form of
VirtualAlloc/CreateFileMapping/MapViewOfFile.

But, 95% of the good properties of allocators
come from clever choice of reuse of blocks, locality consideration,
thread affinity, lock-free-ness, fragmentation factor, etc.

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm



Quote:

> > Ok I know, btw what cryptic new thing?

> The not-so-cryptic "new" operator :-)

> > I need some more advanced memory management API's.
> > Using virtual memory support directly. In my case I need to allocate
memory
> > at a multiple of 4kb boundary.
> Why do you "need" to do that, for what purpose?

> > That's hard to do using malloc without spilling lots of physical memory
> Why do you say so? The only difference is that malloc will (perhaps)
> allocate larger chunks of memory, but it will do it less often.

> Arnaud
> MVP - VC



Tue, 27 Sep 2005 01:44:53 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. C Library for Far Memory Management (Announcement)

2. C/C++ memory management library?

3. is .NET Platform independent as yet ?

4. stdout for system() platform independent

5. Are longs platform-independent??

6. Platform-independent sleep function ?

7. Writing platform independent files

8. platform independent representation of Whitespace

9. Platform independent delays

10. Platform Independent File Locking

11. Platform independent message box or release time assert?

12. platform independent object database

 

 
Powered by phpBB® Forum Software