[base] Don't allocate `library->raster_pool' anymore.

It's unused after the following commits:

  [raster] Allocate render pool for mono rasterizer on the stack.
  [raster] Remove 5-level gray AA mode from monochrome rasterizer.

The value of FT_RENDER_POOL_SIZE still serves the purpose it used to
serve, which is, to adjust the pool size.  But the pool is now
allocated on the stack on demand.

* src/base/ftobjs.c (FT_New_Library, FT_Done_Library): Implement.
This commit is contained in:
Behdad Esfahbod 2015-01-14 18:30:59 +01:00 committed by Werner Lemberg
parent 6dfdaf4d99
commit 5163425344
5 changed files with 24 additions and 25 deletions

View File

@ -1,3 +1,18 @@
2015-01-14 Behdad Esfahbod <behdad@behdad.org>
[base] Don't allocate `library->raster_pool' anymore.
It's unused after the following commits:
[raster] Allocate render pool for mono rasterizer on the stack.
[raster] Remove 5-level gray AA mode from monochrome rasterizer.
The value of FT_RENDER_POOL_SIZE still serves the purpose it used to
serve, which is, to adjust the pool size. But the pool is now
allocated on the stack on demand.
* src/base/ftobjs.c (FT_New_Library, FT_Done_Library): Implement.
2015-01-14 Behdad Esfahbod <behdad@behdad.org>
[base] Do not reorder library->renderers upon use.

View File

@ -378,10 +378,6 @@ FT_BEGIN_HEADER
/* The size in bytes of the render pool used by the scan-line converter */
/* to do all of its work. */
/* */
/* This must be greater than 4KByte if you use FreeType to rasterize */
/* glyphs; otherwise, you may set it to zero to avoid unnecessary */
/* allocation of the render pool. */
/* */
#define FT_RENDER_POOL_SIZE 16384L

View File

@ -378,10 +378,6 @@ FT_BEGIN_HEADER
/* The size in bytes of the render pool used by the scan-line converter */
/* to do all of its work. */
/* */
/* This must be greater than 4KByte if you use FreeType to rasterize */
/* glyphs; otherwise, you may set it to zero to avoid unnecessary */
/* allocation of the render pool. */
/* */
#define FT_RENDER_POOL_SIZE 16384L

View File

@ -1078,10 +1078,10 @@ FT_BEGIN_HEADER
/* FT_Raster_ResetFunc */
/* */
/* <Description> */
/* FreeType provides an area of memory called the `render pool', */
/* available to all registered rasters. This pool can be freely used */
/* during a given scan-conversion but is shared by all rasters. Its */
/* content is thus transient. */
/* FreeType used to provide an area of memory called the `render */
/* pool' available to all registered rasters. This was not thread */
/* safe however and now FreeType never allocates this pool. NULL */
/* is always passed in as pool_base. */
/* */
/* This function is called each time the render pool changes, or just */
/* after a new raster object is created. */
@ -1094,10 +1094,9 @@ FT_BEGIN_HEADER
/* pool_size :: The size in bytes of the render pool. */
/* */
/* <Note> */
/* Rasters can ignore the render pool and rely on dynamic memory */
/* Rasters should ignore the render pool and rely on dynamic or stack */
/* allocation if they want to (a handle to the memory allocator is */
/* passed to the raster constructor). However, this is not */
/* recommended for efficiency purposes. */
/* passed to the raster constructor). */
/* */
typedef void
(*FT_Raster_ResetFunc)( FT_Raster raster,

View File

@ -4666,12 +4666,9 @@
goto Fail;
#endif
/* allocate the render pool */
library->raster_pool_size = FT_RENDER_POOL_SIZE;
#if FT_RENDER_POOL_SIZE > 0
if ( FT_ALLOC( library->raster_pool, FT_RENDER_POOL_SIZE ) )
goto Fail;
#endif
/* we don't use raster_pool anymore. */
library->raster_pool_size = 0;
library->raster_pool = NULL;
library->version_major = FREETYPE_MAJOR;
library->version_minor = FREETYPE_MINOR;
@ -4820,10 +4817,6 @@
}
#endif
/* Destroy raster objects */
FT_FREE( library->raster_pool );
library->raster_pool_size = 0;
#ifdef FT_CONFIG_OPTION_PIC
/* Destroy pic container contents */
ft_pic_container_destroy( library );