void pa_bluetooth_native_backend_free(pa_bluetooth_backend *backend) { pa_assert(backend); pa_dbus_free_pending_list(&backend->pending); if (backend->enable_hs_role) profile_done(backend, PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY); profile_done(backend, PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT); pa_dbus_connection_unref(backend->connection); pa_xfree(backend); }
void pa_bluetooth_native_backend_enable_hs_role(pa_bluetooth_backend *native_backend, bool enable_hs_role) { if (enable_hs_role == native_backend->enable_hs_role) return; if (enable_hs_role) profile_init(native_backend, PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY); else profile_done(native_backend, PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY); native_backend->enable_hs_role = enable_hs_role; }
/*-------------------------------------------------------------------------*/ s32 poly_stage2_run(poly_stage2_t *data) { stage2_stat_t stats; curr_poly_t curr_poly; root_sieve_t root_sieve; assess_t assess; stage2_stat_init(&stats); curr_poly_init(&curr_poly); root_sieve_init(&root_sieve); assess_init(&assess, data->bound0, data->bound1, data->area, data->p_bound); optimize(&curr_poly, data, &root_sieve, &assess, &stats); #ifdef DO_PROFILE profile_done(&stats.profile); printf("\nTiming:"); printf("\nTotal "); profile_print(&stats.profile, PROF_ALL); printf("\n 1. Optimization "); profile_print(&stats.profile, PROF_INITIAL_OPTIMIZE); printf("\n Sieve all "); profile_print(&stats.profile, PROF_SIEVE_ALL); printf("\n Init sieve "); profile_print(&stats.profile, PROF_INIT_SIEVE); printf("\n Sieve "); profile_print(&stats.profile, PROF_SIEVE); printf("\n eval "); profile_print(&stats.profile, PROF_EVAL); printf("\n gmp/alpha1 "); profile_print(&stats.profile, PROF_ALPHA1); printf("\n polroots "); profile_print(&stats.profile, PROF_MURPHY_ROOTS); printf("\n 2. Optimization "); profile_print(&stats.profile, PROF_OPTIMIZE2); printf("\n 3. Optimization "); profile_print(&stats.profile, PROF_OPTIMIZE3); printf("\n murphy-e sum "); profile_print(&stats.profile, PROF_MURPHY_E); printf("\n"); #endif stage2_stat_free(&stats); curr_poly_free(&curr_poly); root_sieve_free(&root_sieve); assess_free(&assess); return 1; }