freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Freetype] Using FT_New_Library() in order to provide custom MM?


From: David Turner
Subject: Re: [Freetype] Using FT_New_Library() in order to provide custom MM?
Date: Fri, 16 Feb 2001 09:12:26 +0100

Hi Jeff,

> 
> Hi Everyone,
> 
> I'm creating a FT_MemoryRec_ statically to make freetype use my own
> memory-management routines.
> However, in FT_Done_Memory, the standard C free() is called on the memory
> pointer that I provided to
> freetype in FT_New_Library.
>
This old bug has been fixed for some time now. You should get
a newer version. FT_Done_Memory now calls "memory->free( memory, memory
)"
so you'll don't need to "malloc" your custom memory manager..
 
> There are a number of issues I'd like to bring up:
> 
> 1) If no custom memory allocators/deallocates are specified, wouldn't it be
> better for freetype to just use
> a static FT_MemoryRec_ to store its function tables, rather than having to
> allocate/deallocate one?
>
As said before, this is a bug. In all cases, FreeType doesn't use a
_single_
static (writable) variable for portability reasons, so this scheme
wouldn't
be appropriate..
 
> 2) If I *do* specify custom memory allocators/deallocators, why am I forced
> to use CRT's alloc() call to create it?
> Using alloc() just once would defeat the purpose of us specifying the custom
> functions. The cleanest way would be to
> declare a static FT_MemoryRec_ object and pass it in to FT_New_Library().
> FT_Done_Freetype() would be changed so that it doesn't delete the memory
> handle at all.
>
Again, it was a bug :-) The ChangeLog says it has been fixed on
2000-12-12
Gee, I'm making 2.0.2 right now, if nobody sees any problem in it..

Thanks for reporting,

Regards,

- David



reply via email to

[Prev in Thread] Current Thread [Next in Thread]