diff --git a/c_src/async_nif.h b/c_src/async_nif.h index c4535b7..76d666a 100644 --- a/c_src/async_nif.h +++ b/c_src/async_nif.h @@ -96,7 +96,7 @@ struct async_nif_state { return enif_make_tuple2(env, enif_make_atom(env, "error"), \ enif_make_atom(env, "enomem")); \ } \ - bzero(req, sizeof(struct async_nif_req_entry)); \ + memset(req, 0, sizeof(struct async_nif_req_entry)); \ copy_of_args = (struct decl ## _args *)enif_alloc(sizeof(struct decl ## _args)); \ if (!copy_of_args) { \ fn_post_ ## decl (args); \ @@ -278,7 +278,7 @@ async_nif_unload(ErlNifEnv *env) async_nif->req_count--; } } - bzero(async_nif, sizeof(struct async_nif_state)); + memset(async_nif, 0, sizeof(struct async_nif_state)); enif_free(async_nif); } @@ -301,7 +301,7 @@ async_nif_load(void) async_nif = enif_alloc(sizeof(struct async_nif_state)); if (!async_nif) return NULL; - bzero(async_nif, sizeof(struct async_nif_state)); + memset(async_nif, 0, sizeof(struct async_nif_state)); async_nif->num_queues = info.scheduler_threads; async_nif->next_q = 0; @@ -316,7 +316,7 @@ async_nif_load(void) } /* Setup the thread pool management. */ - bzero(async_nif->worker_entries, sizeof(struct async_nif_worker_entry) * ASYNC_NIF_MAX_WORKERS); + memset(async_nif->worker_entries, 0, sizeof(struct async_nif_worker_entry) * ASYNC_NIF_MAX_WORKERS); /* Start the worker threads. */ //unsigned int num_workers = ASYNC_NIF_MAX_WORKERS - (ASYNC_NIF_MAX_WORKERS % async_nif->num_queues); @@ -348,7 +348,7 @@ async_nif_load(void) enif_thread_join(async_nif->worker_entries[i].tid, &exit_value); } - bzero(async_nif->worker_entries, sizeof(struct async_nif_worker_entry) * ASYNC_NIF_MAX_WORKERS); + memset(async_nif->worker_entries, 0, sizeof(struct async_nif_worker_entry) * ASYNC_NIF_MAX_WORKERS); return NULL; } } diff --git a/c_src/build_deps.sh b/c_src/build_deps.sh index 40c4886..a70a9d3 100755 --- a/c_src/build_deps.sh +++ b/c_src/build_deps.sh @@ -28,9 +28,9 @@ case "$1" in ./autogen.sh) fi (cd wiredtiger/build_posix && \ - ../configure --with-pic \ + CFLAGS="-I/usr/local/include -L/usr/local/lib" \ + ../configure --with-pic \ --enable-snappy \ - --enable-bzip2 \ --prefix=${BASEDIR}/system && \ make -j && make install) [ -d ${BASEDIR}/../priv ] || mkdir ${BASEDIR}/../priv diff --git a/c_src/bzip2-1.0.6.tar.gz b/c_src/bzip2-1.0.6.tar.gz new file mode 100644 index 0000000..e47e903 Binary files /dev/null and b/c_src/bzip2-1.0.6.tar.gz differ diff --git a/c_src/snappy-1.0.4.tar.gz b/c_src/snappy-1.0.4.tar.gz new file mode 100644 index 0000000..a34852f Binary files /dev/null and b/c_src/snappy-1.0.4.tar.gz differ diff --git a/c_src/wterl.c b/c_src/wterl.c index 69be497..fbbd039 100644 --- a/c_src/wterl.c +++ b/c_src/wterl.c @@ -138,7 +138,7 @@ __close_all_sessions(WterlConnHandle *conn_handle) } kh_destroy(cursors, h); session->close(session, NULL); - bzero(&conn_handle->contexts[i], sizeof(WterlCtx)); + memset(&conn_handle->contexts[i], 0, sizeof(WterlCtx)); } } conn_handle->num_contexts = 0; @@ -297,7 +297,7 @@ ASYNC_NIF_DECL( } conn_handle->conn = conn; conn_handle->num_contexts = 0; - bzero(conn_handle->contexts, sizeof(WterlCtx) * ASYNC_NIF_MAX_WORKERS); + memset(conn_handle->contexts, 0, sizeof(WterlCtx) * ASYNC_NIF_MAX_WORKERS); conn_handle->context_mutex = enif_mutex_create(NULL); ERL_NIF_TERM result = enif_make_resource(env, conn_handle); enif_release_resource(conn_handle);