Esempio n. 1
0
void free_sentence_disjuncts(Sentence sent)
{
	if (NULL != sent->dc_memblock)
	{
		free(sent->dc_memblock);
		sent->dc_memblock = NULL;
	}
	else if (NULL != sent->Disjunct_pool)
	{
		pool_delete(sent->Disjunct_pool);
		pool_delete(sent->Connector_pool);
		sent->Disjunct_pool = NULL;
	}
}
Esempio n. 2
0
void sentence_delete(Sentence sent)
{
	if (!sent) return;
	sat_sentence_delete(sent);
	free_sentence_words(sent);
	wordgraph_delete(sent);
	string_set_delete(sent->string_set);
	free_linkages(sent);
	post_process_free(sent->postprocessor);
	post_process_free(sent->constituent_pp);

	global_rand_state = sent->rand_state;
	pool_delete(sent->fm_Match_node);
	pool_delete(sent->Table_connector_pool);
	free(sent);
}
Esempio n. 3
0
File: http.c Progetto: noelbk/bklib
void
http_header_free(http_header_t *http) {
    http_header_clear(http);
    if( http->pool && http->free_pool ) {
	pool_delete(http->pool);
    }
    http->pool = 0 ;
}
Esempio n. 4
0
static void _ensure_pool_delete_releases_all_allocated_memory( void )
{
	pool_t * pool;
	allocator_counted_t alloc;
	allocator_counted_init_default( &alloc );
	pool = pool_new( 128, 4, allocator_counted_get( &alloc ) );
	pool_delete( pool );
	TEST_REQUIRE( allocator_counted_get_current_count( &alloc ) == 0 );
}
Esempio n. 5
0
static void _ensure_pool_delete_gracefully_handles_cleaned_up_pool( void )
{
	pool_t * pool;
	allocator_counted_t alloc;
	allocator_counted_init_default( &alloc );
	pool = pool_new( 128, 4, allocator_counted_get( &alloc ) );
	pool_cleanup( pool );
	pool_delete( pool );
	TEST_REQUIRE( allocator_counted_get_current_count( &alloc ) == 0 );
}
Esempio n. 6
0
/**
 * free all of the hash tables and C_lists
 */
static void power_table_delete(power_table *pt)
{
	pool_delete(pt->memory_pool);
	for (WordIdx w = 0; w < pt->power_table_size; w++)
	{
		xfree((char *)pt->l_table[w], pt->l_table_size[w] * sizeof (C_list *));
		xfree((char *)pt->r_table[w], pt->r_table_size[w] * sizeof (C_list *));
	}
	xfree(pt->l_table_size, 2 * pt->power_table_size * sizeof(unsigned int));
	xfree(pt->l_table, 2 * pt->power_table_size * sizeof(C_list **));
}
Esempio n. 7
0
static void _ensure_pool_new_returns_initialised_pool( void )
{
	pool_t * pool;
	allocator_guarded_t alloc;
	allocator_guarded_init_default( &alloc );
	pool = pool_new( 128, 4, allocator_guarded_get( &alloc ) );
	TEST_REQUIRE( pool );
	TEST_REQUIRE( pool->buffer );
	TEST_REQUIRE( allocator_guarded_length( pool->buffer ) >= 128 * 4 );
	TEST_REQUIRE( pool->next );
	TEST_REQUIRE( pool->allocator == allocator_guarded_get( &alloc ) );
	pool_delete( pool );
}
Esempio n. 8
0
int
http_redirect_client_free(http_redirect_client_t *client) {
    http_redirect_t *server = client->server;

    http_header_clear(&client->http_req);
    if( client->send_file ) {
	fclose(client->send_file);
    }
    if( client->sock ) {
	sock_close(client->sock);
	fdselect_unset(server->fdselect, client->sock, FDSELECT_WRITE);
	fdselect_unset(server->fdselect, client->sock, FDSELECT_READ);
    }
    if( client->pool ) {
	pool_delete(client->pool);
    }
    memset(client, 0, sizeof(*client));
    return 0;
}
Esempio n. 9
0
int
http_redirect_free(http_redirect_t *server) {
    if(server->pool) pool_delete(server->pool);
    memset(server, 0, sizeof(*server));
    return 0;
}
Esempio n. 10
0
	// Destructor.
	~qmidinetJackMidiQueue ()
	{
		pool_delete(m_pool);
		delete [] m_items;
	}
Esempio n. 11
0
static int io_server_close(struct io *io)
{
    pool_delete(io->pool);
    return IO_OK;
}
Esempio n. 12
0
/* skiplist_delete SKIPLIST
 * Delete SKIPLIST and all associated memory. If all data have been inserted
 * with skiplist_insert_copy, this will free all associated data, too. */
void skiplist_delete(skiplist S) {
    pool_delete(S->P);
    xfree(S);
}
Esempio n. 13
0
File: http.c Progetto: noelbk/bklib
void
url_free(url_t *url) {
    pool_delete(url->pool);
    memset(url, 0, sizeof(*url));
}
Esempio n. 14
0
static void _ensure_pool_delete_gracefully_handles_null_pool( void )
{
	pool_delete( 0 );
}