Обсуждение: pgsql: Clean up temporary-memory management during ispell dictionary lo

Поиск
Список
Период
Сортировка

pgsql: Clean up temporary-memory management during ispell dictionary lo

От
Tom Lane
Дата:
Clean up temporary-memory management during ispell dictionary loading.

Add explicit initialization and cleanup functions to spell.c, and keep
all working state in the already-existing ISpellDict struct.  This lets us
get rid of a static variable along with some extremely shaky assumptions
about usage of child memory contexts.

This commit is just code beautification and has no impact on functionality
or performance, but it opens the way to a less-grotty implementation of
Pavel's memory-saving hack, which will follow shortly.

Branch
------
master

Details
-------
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=9b910def24e85c1c4ff993eae0fe511271fc8682

Modified Files
--------------
src/backend/tsearch/dict_ispell.c |    5 +-
src/backend/tsearch/spell.c       |   86 +++++++++++++++++++-----------------
src/include/tsearch/dicts/spell.h |   22 ++++++---
3 files changed, 62 insertions(+), 51 deletions(-)