[cairo] Using OS/2 memory allocation APIs

Peter Weilbacher mozilla at Weilbacher.org
Tue Nov 20 05:33:04 PST 2007


On Mon, 19 Nov 2007, Behdad Esfahbod wrote:

> If you ask me, there's no way to get that in cairo.  It's just plain
> ugly and totally against cairo's coding standards.  If it didn't need a
> different free function there was some hope of doing it, but with a
> separate free() I don't think so.
>
> If we go ahead and do add that, one can request a similar change for
> Linux to use mmap for large allocations.  Probably similar stuff exist
> on other platforms too.  But I think we should just leave that to libc
> hackers.  OS/2 is no exception IMO.

So, what do you suggest how I should solve the problem instead? If your 
suggestion is "change the C library" then I can tell you upfront that I 
don't have that choice...[1]
Are you even against adding the patch I posted, i.e. to have it fully 
contained within cairo-os2-surface.c?

And about the different free function: in the cases that I have pointed 
out (I could give more detail) there is always a function that allocates 
stuff and a corresponding function that frees stuff. So it's not like 
for those allocations I would need to add the DosAllocMem() in one file 
and the corresponding DosFreeMem() in another one or even worse several 
other ones.

    Peter.

[1] One other possibility would be to use C library functionality to
     create additional heaps, but that would need even more lines and be
     way more ugly...


More information about the cairo mailing list