]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Remove unused functions
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 26 Aug 2017 22:32:55 +0000 (23:32 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 27 Aug 2017 11:36:19 +0000 (12:36 +0100)
src/libutil/mem_pool.c
src/libutil/mem_pool.h
src/libutil/util.c
src/libutil/util.h

index 4a2f54b6414d3ba27991592b51159d3191e1efd4..8f595c1ee2114cf76890ee7040d1eb206d33a810 100644 (file)
@@ -537,24 +537,6 @@ rspamd_mempool_ftokdup (rspamd_mempool_t *pool, const rspamd_ftok_t *src)
        return newstr;
 }
 
-gchar *
-rspamd_mempool_strdup_shared (rspamd_mempool_t * pool, const gchar *src)
-{
-       gsize len;
-       gchar *newstr;
-
-       if (src == NULL) {
-               return NULL;
-       }
-
-       len = strlen (src);
-       newstr = rspamd_mempool_alloc_shared (pool, len + 1);
-       memcpy (newstr, src, len);
-       newstr[len] = '\0';
-
-       return newstr;
-}
-
 void
 rspamd_mempool_add_destructor_full (rspamd_mempool_t * pool,
        rspamd_mempool_destruct_t func,
index 59a4d06155b0dfac96f38f01d395d13badf3a2ad..7423895c4cfe4a6ffc430d387dcfdc9b30e95eda 100644 (file)
@@ -197,8 +197,6 @@ gchar * rspamd_mempool_ftokdup (rspamd_mempool_t *pool,
  */
 void * rspamd_mempool_alloc_shared (rspamd_mempool_t * pool, gsize size);
 void * rspamd_mempool_alloc0_shared (rspamd_mempool_t *pool, gsize size);
-gchar * rspamd_mempool_strdup_shared (rspamd_mempool_t * pool,
-       const gchar *src);
 /**
  * Add destructor callback to pool
  * @param pool memory pool object
index fbd1ba8239e5b6785f44c55e972f58614e9b0976..f2d9d41b0fb705b312eeac9c82e7a0e1f24d910e 100644 (file)
@@ -1523,90 +1523,6 @@ rspamd_mutex_free (rspamd_mutex_t *mtx)
        g_slice_free1 (sizeof (rspamd_mutex_t), mtx);
 }
 
-/**
- * Create new rwlock
- * @return
- */
-rspamd_rwlock_t *
-rspamd_rwlock_new (void)
-{
-       rspamd_rwlock_t *new;
-
-       new = g_malloc (sizeof (rspamd_rwlock_t));
-#if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION > 30))
-       g_rw_lock_init (&new->rwlock);
-#else
-       g_static_rw_lock_init (&new->rwlock);
-#endif
-
-       return new;
-}
-
-/**
- * Lock rwlock for writing
- * @param mtx
- */
-inline void
-rspamd_rwlock_writer_lock (rspamd_rwlock_t *mtx)
-{
-#if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION > 30))
-       g_rw_lock_writer_lock (&mtx->rwlock);
-#else
-       g_static_rw_lock_writer_lock (&mtx->rwlock);
-#endif
-}
-
-/**
- * Lock rwlock for reading
- * @param mtx
- */
-inline void
-rspamd_rwlock_reader_lock (rspamd_rwlock_t *mtx)
-{
-#if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION > 30))
-       g_rw_lock_reader_lock (&mtx->rwlock);
-#else
-       g_static_rw_lock_reader_lock (&mtx->rwlock);
-#endif
-}
-
-/**
- * Unlock rwlock from writing
- * @param mtx
- */
-inline void
-rspamd_rwlock_writer_unlock (rspamd_rwlock_t *mtx)
-{
-#if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION > 30))
-       g_rw_lock_writer_unlock (&mtx->rwlock);
-#else
-       g_static_rw_lock_writer_unlock (&mtx->rwlock);
-#endif
-}
-
-/**
- * Unlock rwlock from reading
- * @param mtx
- */
-inline void
-rspamd_rwlock_reader_unlock (rspamd_rwlock_t *mtx)
-{
-#if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION > 30))
-       g_rw_lock_reader_unlock (&mtx->rwlock);
-#else
-       g_static_rw_lock_reader_unlock (&mtx->rwlock);
-#endif
-}
-
-void
-rspamd_rwlock_free (rspamd_rwlock_t *mtx)
-{
-#if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION > 30))
-       g_rw_lock_clear (&mtx->rwlock);
-#endif
-       g_slice_free1 (sizeof (rspamd_rwlock_t), mtx);
-}
-
 struct rspamd_thread_data {
        gchar *name;
        gint id;
index d1d83716efe31f493996b9e10e1c7e7822959fe1..d8a1eae6087bdcba4083d9efae5a1a5fca32e235 100644 (file)
@@ -229,14 +229,6 @@ typedef struct rspamd_mutex_s {
 #endif
 } rspamd_mutex_t;
 
-typedef struct rspamd_rwlock_s {
-#if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION > 30))
-       GRWLock rwlock;
-#else
-       GStaticRWLock rwlock;
-#endif
-} rspamd_rwlock_t;
-
 
 /**
  * Create new mutex
@@ -262,42 +254,6 @@ void rspamd_mutex_unlock (rspamd_mutex_t *mtx);
  */
 void rspamd_mutex_free (rspamd_mutex_t *mtx);
 
-/**
- * Create new rwloc
- * @return
- */
-rspamd_rwlock_t * rspamd_rwlock_new (void);
-
-/**
- * Lock rwlock for writing
- * @param mtx
- */
-void rspamd_rwlock_writer_lock (rspamd_rwlock_t *mtx);
-
-/**
- * Lock rwlock for reading
- * @param mtx
- */
-void rspamd_rwlock_reader_lock (rspamd_rwlock_t *mtx);
-
-/**
- * Unlock rwlock from writing
- * @param mtx
- */
-void rspamd_rwlock_writer_unlock (rspamd_rwlock_t *mtx);
-
-/**
- * Unlock rwlock from reading
- * @param mtx
- */
-void rspamd_rwlock_reader_unlock (rspamd_rwlock_t *mtx);
-
-/**
- * Free rwlock
- * @param mtx
- */
-void rspamd_rwlock_free (rspamd_rwlock_t *mtx);
-
 /**
  * Create new named thread
  * @param name name pattern