1 #include <ft2build.h> 2 #include FT_SYSTEM_MEMORY_H 3 4 static FT_Memory ft_memory_new_default(FT_ULong size)5 ft_memory_new_default( FT_ULong size ) 6 { 7 return (FT_Memory) ft_malloc( size ); 8 } 9 10 static void ft_memory_destroy_default(FT_Memory memory)11 ft_memory_destroy_default( FT_Memory memory ) 12 { 13 ft_free( memory ); 14 } 15 16 17 /* notice that in normal builds, we use the ISO C library functions */ 18 /* 'malloc', 'free' and 'realloc' directly.. */ 19 /* */ 20 static const FT_Memory_FuncsRec ft_memory_funcs_default_rec = 21 { 22 (FT_Memory_CreateFunc) ft_memory_new_iso, 23 (FT_Memory_DestroyFunc) ft_memory_destroy_iso, 24 (FT_Memory_AllocFunc) ft_malloc, 25 (FT_Memory_FreeFunc) ft_free, 26 (FT_Memory_ReallocFunc) ft_realloc 27 }; 28 29 FT_APIVAR_DEF( const FT_Memory_Funcs ) 30 ft_memory_funcs_default = &ft_memory_funcs_defaults_rec; 31