[Bf-committers] Re: [Bf-blender-cvs] CVS commit: blender/intern/guardedalloc MEM_guardedalloc.h blender/intern/guardedalloc/intern mallocn.c

Jean-Luc Peurière jlp at nerim.net
Thu Feb 16 21:37:20 CET 2006


Le 16 févr. 06 à 18:51, Ton Roosendaal a écrit :

> ton (Ton Roosendaal) 2006/02/16 18:51:01 CET
>
>   Modified files:
>     blender/intern/guardedalloc MEM_guardedalloc.h
>     blender/intern/guardedalloc/intern mallocn.c
>
>   Log:
>   Added new malloc type in our MEM module; using the unix feature  
> 'mmap'.
>
> ...

>   Now here's mmap to the rescue! It has a very nice feature to map to
>   a virtual (non existing) file, allowing to allocate disk-mapped  
> memory
>   on the fly. For as long there's real memory it works nearly as  
> fast as
>   a regular malloc, and when you go to the swap boundary, it knows  
> nicely
>   what to swap first.
>
>


> ....

>   For Windows there's no mmap() available, but I'm pretty sure  
> there's an
>   equivalent. Windows gurus here are invited to insert that here in  
> code! At
>   the moment it's nicely ifdeffed, so for Windows the mmap defaults  
> to a
>   regular alloc.


a solution for windows : http://www.genesys-e.de/jwalter/mix4win.htm

the complex code is for sbrk, mmap is simple

no idea if it is efficient, just happens i had the link handy ;)

JLuc



More information about the Bf-committers mailing list