Commit 8dcce6f9 authored by Bob Halley's avatar Bob Halley

change memctx to mem

parent 4cafb28a
......@@ -37,7 +37,7 @@
#include <arpa/inet.h>
isc_memctx_t *mctx = NULL;
isc_mem_t *mctx = NULL;
int sockets_active = 0;
static void my_send(isc_task_t *task, isc_event_t *event);
......@@ -272,7 +272,7 @@ main(int argc, char *argv[])
workers = 2;
printf("%d workers\n", workers);
INSIST(isc_memctx_create(0, 0, &mctx) == ISC_R_SUCCESS);
INSIST(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
INSIST(isc_taskmgr_create(mctx, workers, 0, &manager) ==
ISC_R_SUCCESS);
......@@ -390,7 +390,7 @@ main(int argc, char *argv[])
isc_taskmgr_destroy(&manager);
isc_mem_stats(mctx, stdout);
isc_memctx_destroy(&mctx);
isc_mem_destroy(&mctx);
return (0);
}
......@@ -28,7 +28,7 @@
#include <isc/result.h>
#include <isc/timer.h>
isc_memctx_t *mctx = NULL;
isc_mem_t *mctx = NULL;
static void
my_callback(isc_task_t *task, isc_event_t *event)
......@@ -78,7 +78,7 @@ main(int argc, char *argv[]) {
workers = 2;
printf("%d workers\n", workers);
INSIST(isc_memctx_create(0, 0, &mctx) == ISC_R_SUCCESS);
INSIST(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
INSIST(isc_taskmgr_create(mctx, workers, 0, &manager) ==
ISC_R_SUCCESS);
......@@ -173,5 +173,5 @@ main(int argc, char *argv[]) {
printf("destroyed\n");
isc_mem_stats(mctx, stdout);
isc_memctx_destroy(&mctx);
isc_mem_destroy(&mctx);
}
......@@ -28,7 +28,7 @@
#include <isc/result.h>
#include <isc/timer.h>
isc_memctx_t *mctx = NULL;
isc_mem_t *mctx = NULL;
isc_task_t *t1, *t2, *t3;
isc_timer_t *ti1, *ti2, *ti3;
int tick_count = 0;
......@@ -110,7 +110,7 @@ main(int argc, char *argv[]) {
workers = 2;
printf("%d workers\n", workers);
INSIST(isc_memctx_create(0, 0, &mctx) == ISC_R_SUCCESS);
INSIST(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
INSIST(isc_taskmgr_create(mctx, workers, 0, &manager) ==
ISC_R_SUCCESS);
INSIST(isc_timermgr_create(mctx, &timgr) == ISC_R_SUCCESS);
......@@ -158,5 +158,5 @@ main(int argc, char *argv[]) {
printf("destroyed\n");
isc_mem_stats(mctx, stdout);
isc_memctx_destroy(&mctx);
isc_mem_destroy(&mctx);
}
......@@ -49,7 +49,7 @@
struct isc_heap {
unsigned int magic;
isc_memctx_t * mctx;
isc_mem_t * mctx;
unsigned int size;
unsigned int size_increment;
unsigned int last;
......@@ -59,7 +59,7 @@ struct isc_heap {
};
isc_result_t
isc_heap_create(isc_memctx_t *mctx, isc_heapcompare_t compare,
isc_heap_create(isc_mem_t *mctx, isc_heapcompare_t compare,
isc_heapindex_t index, unsigned int size_increment,
isc_heap_t **heapp)
{
......
......@@ -30,7 +30,7 @@ typedef void (*isc_heapaction_t)(void *, void *);
typedef struct isc_heap isc_heap_t;
isc_result_t isc_heap_create(isc_memctx_t *, isc_heapcompare_t,
isc_result_t isc_heap_create(isc_mem_t *, isc_heapcompare_t,
isc_heapindex_t, unsigned int, isc_heap_t **);
void isc_heap_destroy(isc_heap_t **);
isc_result_t isc_heap_insert(isc_heap_t *, void *);
......
......@@ -538,7 +538,7 @@ isc_socket_sendmark(isc_socket_t *sock,
*/
isc_result_t
isc_socketmgr_create(isc_memctx_t *mctx, isc_socketmgr_t **managerp);
isc_socketmgr_create(isc_mem_t *mctx, isc_socketmgr_t **managerp);
/*
* Create a socket manager.
*
......
......@@ -54,7 +54,7 @@ typedef void (*isc_eventdestructor_t)(isc_event_t *);
* defining new event types.
*/
struct isc_event {
isc_memctx_t * mctx;
isc_mem_t * mctx;
size_t size;
void * sender;
isc_eventtype_t type;
......@@ -69,7 +69,7 @@ struct isc_event {
typedef LIST(struct isc_event) isc_eventlist_t;
isc_event_t * isc_event_allocate(isc_memctx_t *,
isc_event_t * isc_event_allocate(isc_mem_t *,
void *,
isc_eventtype_t,
isc_taskaction_t,
......@@ -104,7 +104,7 @@ void isc_task_destroy(isc_task_t **);
*** Task Manager.
***/
isc_result_t isc_taskmgr_create(isc_memctx_t *,
isc_result_t isc_taskmgr_create(isc_mem_t *,
unsigned int,
unsigned int,
isc_taskmgr_t **);
......
......@@ -251,7 +251,7 @@ isc_timer_detach(isc_timer_t **timerp);
*/
isc_result_t
isc_timermgr_create(isc_memctx_t *mctx, isc_timermgr_t **managerp);
isc_timermgr_create(isc_mem_t *mctx, isc_timermgr_t **managerp);
/*
* Create a timer manager.
*
......
......@@ -73,7 +73,7 @@ struct isc_task {
struct isc_taskmgr {
/* Not locked. */
unsigned int magic;
isc_memctx_t * mctx;
isc_mem_t * mctx;
isc_mutex_t lock;
unsigned int workers;
isc_thread_t * threads;
......@@ -94,7 +94,7 @@ struct isc_taskmgr {
***/
static inline isc_event_t *
event_allocate(isc_memctx_t *mctx, void *sender, isc_eventtype_t type,
event_allocate(isc_mem_t *mctx, void *sender, isc_eventtype_t type,
isc_taskaction_t action, void *arg, size_t size)
{
isc_event_t *event;
......@@ -115,7 +115,7 @@ event_allocate(isc_memctx_t *mctx, void *sender, isc_eventtype_t type,
}
isc_event_t *
isc_event_allocate(isc_memctx_t *mctx, void *sender, isc_eventtype_t type,
isc_event_allocate(isc_mem_t *mctx, void *sender, isc_eventtype_t type,
isc_taskaction_t action, void *arg, size_t size)
{
if (size < sizeof (struct isc_event))
......@@ -703,7 +703,7 @@ manager_free(isc_taskmgr_t *manager) {
}
isc_result_t
isc_taskmgr_create(isc_memctx_t *mctx, unsigned int workers,
isc_taskmgr_create(isc_mem_t *mctx, unsigned int workers,
unsigned int default_quantum, isc_taskmgr_t **managerp)
{
unsigned int i, started = 0;
......
......@@ -74,7 +74,7 @@ struct isc_timer {
struct isc_timermgr {
/* Not locked. */
unsigned int magic;
isc_memctx_t * mctx;
isc_mem_t * mctx;
isc_mutex_t lock;
/* Locked by manager lock. */
isc_boolean_t done;
......@@ -547,7 +547,7 @@ set_index(void *what, unsigned int index) {
}
isc_result_t
isc_timermgr_create(isc_memctx_t *mctx, isc_timermgr_t **managerp) {
isc_timermgr_create(isc_mem_t *mctx, isc_timermgr_t **managerp) {
isc_timermgr_t *manager;
isc_result_t result;
......
......@@ -137,7 +137,7 @@ struct isc_socket {
struct isc_socketmgr {
/* Not locked. */
unsigned int magic;
isc_memctx_t * mctx;
isc_mem_t * mctx;
isc_mutex_t lock;
/* Locked by manager lock. */
unsigned int nsockets; /* sockets managed */
......@@ -1436,7 +1436,7 @@ watcher(void *uap)
* Create a new socket manager.
*/
isc_result_t
isc_socketmgr_create(isc_memctx_t *mctx, isc_socketmgr_t **managerp)
isc_socketmgr_create(isc_mem_t *mctx, isc_socketmgr_t **managerp)
{
isc_socketmgr_t *manager;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment