Przemysław Czerpak wrote:
> 
> It should not be a problem. VirtualQuery() is used to free continues memory
> region allocated in more then one VirtualAlloc() calls and seems that we can
> easy replicate all MS-Windows conditions using DosQueryMem()
> Seems that the final version can look like the code below.
> I'm only not sure about OBJ_TILE usage. In fact it's optional to reduce

It is used when memory needs to be accessed by 16bit code (thunking), for
example when passing a pointer to such code.

I think you can safely remove it.

> fragmentation so we do not have to use it at all but if we can find sth
> to for allocation virtual memory addresses from two different sides of
> process virtual address space then it will be nice.
> 
I don't think you can decide from where inside the address space you can
allocate memory.

> 
>    #define INCL_DOSMEMMGR
> 
>    #define CALL_MMAP(s)         os2mmap(s)
>    #define CALL_MUNMAP(a, s)    os2munmap((a), (s))
>    #define DIRECT_MMAP(s)       os2direct_mmap(s)
> 
> 
> If you can confirm that it should work then I'll commit it to SVN and
> I would like to ask you or David to make tests in real OS2 environment.
> 

I'll do some tests later today and then I'll let you know.

Maurilio.

PS. When calling DosAllocMem() a 64Kb object gets allocated even for a single
byte request. Is there something to make dlmalloc aware of this fact?
Otherwise we could end up wasting a lot of memory.

"Note: DosAllocMem and DosAllocSharedMem both allocate a block of memory of
the size requested rounded up to the nearest page. On OS/2 Warp, the system
allocates a 64K object without attributes on every allocation.

For example, for a DosAllocMem call with a size of 1, the system allocates a
4096-byte block of committed memory plus 61440 bytes without attributes. "

-- 
 __________
|  |  | |__| Maurilio Longo
|_|_|_|____| farmaconsult s.r.l.


_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to