Skip to content

Commit

Permalink
DTrace probe fix, Fix typo in configure script, Use calloc(3) instead…
Browse files Browse the repository at this point in the history
… of malloc(3) for thread structures.
  • Loading branch information
Ricky Zhou authored and dustin committed Jan 3, 2009
1 parent 7a2dd7a commit b2e7e90
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ AC_SUBST(DTRACE_DEBUG_OBJ)
AC_SUBST(DTRACEFLAGS)

AC_ARG_ENABLE(64bit,
[AS_HELP_STRING([--enable-64bit],[build 64bit verison])])
[AS_HELP_STRING([--enable-64bit],[build 64bit version])])
if test "x$enable_64bit" == "xyes"
then
org_cflags=$CFLAGS
Expand Down
4 changes: 2 additions & 2 deletions thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ void dispatch_conn_new(int sfd, enum conn_states init_state, int event_flags,

cq_push(&thread->new_conn_queue, item);

MEMCACHED_CONN_DISPATCH(sfd, threads[thread].thread_id);
MEMCACHED_CONN_DISPATCH(sfd, thread->thread_id);
if (write(thread->notify_send_fd, "", 1) != 1) {
perror("Writing to thread notify pipe");
}
Expand Down Expand Up @@ -624,7 +624,7 @@ void thread_init(int nthreads, struct event_base *main_base) {
pthread_mutex_init(&cqi_freelist_lock, NULL);
cqi_freelist = NULL;

threads = malloc(sizeof(LIBEVENT_THREAD) * nthreads);
threads = calloc(nthreads, sizeof(LIBEVENT_THREAD));
if (! threads) {
perror("Can't allocate thread descriptors");
exit(1);
Expand Down

0 comments on commit b2e7e90

Please sign in to comment.