[asterisk-commits] akshayb: branch akshayb/ao2_containers r265270 - /team/akshayb/ao2_containers...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sun May 23 17:38:55 CDT 2010
Author: akshayb
Date: Sun May 23 17:38:54 2010
New Revision: 265270
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=265270
Log:
Minor Changes in astobj2.c and astobj2.h. Next Changes to done to initialize the ao2_container
Modified:
team/akshayb/ao2_containers/main/astobj2.c
Modified: team/akshayb/ao2_containers/main/astobj2.c
URL: http://svnview.digium.com/svn/asterisk/team/akshayb/ao2_containers/main/astobj2.c?view=diff&rev=265270&r1=265269&r2=265270
==============================================================================
--- team/akshayb/ao2_containers/main/astobj2.c (original)
+++ team/akshayb/ao2_containers/main/astobj2.c Sun May 23 17:38:54 2010
@@ -381,6 +381,8 @@
int version;
};
+
+
struct ao2_container {
ao2_contaniner_core core;
ao2_hash_fn *hash_fn;
@@ -392,6 +394,8 @@
};
+
+
//Left Old code for reference. Has to be removed once work done
@@ -445,6 +449,15 @@
return c;
}
+/*
+ * function ao2_container_size : to calculate size of ao2_container that would
+ * allocated by using __ao2_alloc_debug and __ao2_alloc
+ */
+
+size_t ao2_container_size (
+
+
+
struct ao2_container *__ao2_container_alloc_debug(const unsigned int n_buckets, ao2_hash_fn *hash_fn,
ao2_callback_fn *cmp_fn, char *tag, char *file, int line,
const char *funcname, int ref_debug)
@@ -465,6 +478,7 @@
/* compute the container size */
const unsigned int num_buckets = hash_fn ? n_buckets : 1;
+ /* replace this size callculation by a function that is to be supplied by the writter as, buckets is not common in btree and other data structures. This has to be done when writing code for btree part. */
size_t container_size = sizeof(struct ao2_container) + num_buckets * sizeof(struct bucket);
struct ao2_container *c = __ao2_alloc(container_size, container_destruct);
More information about the asterisk-commits
mailing list