Skip to content

Commit

Permalink
removed the string pool
Browse files Browse the repository at this point in the history
Users of this library should implement their own string pooling.
Pooling may not be a good idea for some clients, e.g. mpc.
  • Loading branch information
MaxKellermann committed Sep 21, 2009
1 parent ebe624d commit 405e42e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 180 deletions.
1 change: 0 additions & 1 deletion Makefile.am
Expand Up @@ -41,7 +41,6 @@ src_libmpdclient_la_SOURCES = \
src/async.c src/iasync.h \
src/buffer.h \
src/internal.h \
src/str_pool.c src/str_pool.h \
src/ierror.c src/ierror.h \
src/resolver.c src/resolver.h \
src/capabilities.c \
Expand Down
11 changes: 5 additions & 6 deletions src/song.c
Expand Up @@ -33,7 +33,6 @@
#include <mpd/song.h>
#include <mpd/pair.h>
#include <mpd/recv.h>
#include "str_pool.h"
#include "internal.h"
#include "iso8601.h"

Expand Down Expand Up @@ -93,7 +92,7 @@ mpd_song_new(const char *uri)
song->id = 0;

song->tags[MPD_TAG_FILE].next = NULL;
song->tags[MPD_TAG_FILE].value = str_pool_get(uri);
song->tags[MPD_TAG_FILE].value = strdup(uri);
if (song->tags[MPD_TAG_FILE].value == NULL) {
free(song);
return NULL;
Expand All @@ -111,13 +110,13 @@ void mpd_song_free(struct mpd_song *song) {
if (tag->value == NULL)
continue;

str_pool_put(tag->value);
free(tag->value);

tag = tag->next;

while (tag != NULL) {
assert(tag->value != NULL);
str_pool_put(tag->value);
free(tag->value);

next = tag->next;
free(tag);
Expand Down Expand Up @@ -183,7 +182,7 @@ mpd_song_add_tag(struct mpd_song *song,

if (tag->value == NULL) {
tag->next = NULL;
tag->value = str_pool_get(value);
tag->value = strdup(value);
if (tag->value == NULL)
return false;
} else {
Expand All @@ -195,7 +194,7 @@ mpd_song_add_tag(struct mpd_song *song,
if (tag == NULL)
return NULL;

tag->value = str_pool_get(value);
tag->value = strdup(value);
if (tag->value == NULL) {
free(tag);
return false;
Expand Down
135 changes: 0 additions & 135 deletions src/str_pool.c

This file was deleted.

38 changes: 0 additions & 38 deletions src/str_pool.h

This file was deleted.

0 comments on commit 405e42e

Please sign in to comment.