ftsysmem.c 870 B

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