Skip to content

Commit

Permalink
Fix typo (Swoole\MsgQueue::destroy incompatible backwards)
Browse files Browse the repository at this point in the history
  • Loading branch information
twose committed Nov 24, 2018
1 parent 9ea8df1 commit 28e4cd4
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion include/swoole.h
Original file line number Diff line number Diff line change
Expand Up @@ -1758,7 +1758,7 @@ int swReactor_setHandle(swReactor *, int, swReactor_handle);
int swReactor_empty(swReactor *reactor);

void swReactor_defer_task_create(swReactor *reactor);
void swReactor_defer_task_destory(swReactor *reactor);
void swReactor_defer_task_destroy(swReactor *reactor);

static sw_inline swConnection* swReactor_get(swReactor *reactor, int fd)
{
Expand Down
2 changes: 1 addition & 1 deletion php_swoole.h
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ PHP_FUNCTION(swoole_fast_serialize);
PHP_FUNCTION(swoole_unserialize);
#endif

void swoole_destory_table(zend_resource *rsrc);
void swoole_destroy_table(zend_resource *rsrc);

void swoole_server_port_init(int module_number);
void swoole_async_init(int module_number);
Expand Down
2 changes: 1 addition & 1 deletion src/core/array.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ swArray *swArray_new(int page_size, size_t item_size)
}

/**
* Destory the array
* Destroy the array
*/
void swArray_free(swArray *array)
{
Expand Down
6 changes: 3 additions & 3 deletions src/memory/ring_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ typedef struct
char data[0];
} swRingBuffer_item;

static void swRingBuffer_destory(swMemoryPool *pool);
static void swRingBuffer_destroy(swMemoryPool *pool);
static void* swRingBuffer_alloc(swMemoryPool *pool, uint32_t size);
static void swRingBuffer_free(swMemoryPool *pool, void *ptr);

Expand Down Expand Up @@ -70,7 +70,7 @@ swMemoryPool *swRingBuffer_new(uint32_t size, uint8_t shared)
mem = (char *) mem + sizeof(swMemoryPool);

pool->object = object;
pool->destroy = swRingBuffer_destory;
pool->destroy = swRingBuffer_destroy;
pool->free = swRingBuffer_free;
pool->alloc = swRingBuffer_alloc;

Expand Down Expand Up @@ -198,7 +198,7 @@ static void swRingBuffer_free(swMemoryPool *pool, void *ptr)
sw_atomic_fetch_add(free_count, 1);
}

static void swRingBuffer_destory(swMemoryPool *pool)
static void swRingBuffer_destroy(swMemoryPool *pool)
{
swRingBuffer *object = pool->object;
if (object->shared)
Expand Down
2 changes: 1 addition & 1 deletion src/reactor/defer_task.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void swReactor_defer_task_create(swReactor *reactor)
reactor->do_defer_tasks = do_defer_tasks;
}

void swReactor_defer_task_destory(swReactor *reactor)
void swReactor_defer_task_destroy(swReactor *reactor)
{
list<defer_task *> *tasks = (list<defer_task *> *) reactor->defer_tasks;
delete tasks;
Expand Down
6 changes: 3 additions & 3 deletions swoole_msgqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ static PHP_METHOD(swoole_msgqueue, push);
static PHP_METHOD(swoole_msgqueue, pop);
static PHP_METHOD(swoole_msgqueue, setBlocking);
static PHP_METHOD(swoole_msgqueue, stats);
static PHP_METHOD(swoole_msgqueue, destory);
static PHP_METHOD(swoole_msgqueue, destroy);

static zend_class_entry swoole_msgqueue_ce;
zend_class_entry *swoole_msgqueue_class_entry_ptr;
Expand Down Expand Up @@ -55,7 +55,7 @@ static const zend_function_entry swoole_msgqueue_methods[] =
PHP_ME(swoole_msgqueue, pop, arginfo_swoole_msgqueue_pop, ZEND_ACC_PUBLIC)
PHP_ME(swoole_msgqueue, setBlocking, arginfo_swoole_msgqueue_setBlocking, ZEND_ACC_PUBLIC)
PHP_ME(swoole_msgqueue, stats, arginfo_swoole_void, ZEND_ACC_PUBLIC)
PHP_ME(swoole_msgqueue, destory, arginfo_swoole_void, ZEND_ACC_PUBLIC)
PHP_ME(swoole_msgqueue, destroy, arginfo_swoole_void, ZEND_ACC_PUBLIC)
PHP_FE_END
};

Expand Down Expand Up @@ -169,7 +169,7 @@ static PHP_METHOD(swoole_msgqueue, stats)
}
}

static PHP_METHOD(swoole_msgqueue, destory)
static PHP_METHOD(swoole_msgqueue, destroy)
{
swMsgQueue *queue = swoole_get_object(getThis());
SW_CHECK_RETURN(swMsgQueue_free(queue));
Expand Down
2 changes: 1 addition & 1 deletion tests/swoole_coroutine/swap_callback/log.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ co::onSwap(function (int $state, int $cid, int $origin_cid) {
$cid1 = $origin_cid;
$cid2 = $cid;
break;
case SWOOLE_CORO_WATING:
case SWOOLE_CORO_WAITING:
$state = 'yield';
$cid1 = $cid;
$cid2 = $origin_cid;
Expand Down

0 comments on commit 28e4cd4

Please sign in to comment.