explain the mem_assert macro to me

manoj15
Posts: 8
Joined: Mon Apr 22, 2019 6:40 pm

explain the mem_assert macro to me

Postby manoj15 » Tue May 07, 2019 4:40 pm

I am tinkering around esp-adf and found this snippet of code

Code: Select all


    ESP_LOGI(TAG, "[3.0] Create audio pipeline for playback");
    audio_pipeline_cfg_t pipeline_cfg = DEFAULT_AUDIO_PIPELINE_CONFIG();
    pipeline = audio_pipeline_init(&pipeline_cfg);
    mem_assert(pipeline);


what is the mem_assert(piperline) line does ?

it's defined in audio_common.h
#define mem_assert(x)

can anyone explain ?

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: explain this to me

Postby WiFive » Wed May 08, 2019 4:24 am

By default it doesn't do anything but seems intended for throwing an exception similar to ESP_ERROR_CHECK for debugging

manoj15
Posts: 8
Joined: Mon Apr 22, 2019 6:40 pm

Re: explain the mem_assert macro to me

Postby manoj15 » Sun May 12, 2019 12:15 pm

where's the statement if it's to throw some exception?

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: explain the mem_assert macro to me

Postby WiFive » Sun May 12, 2019 7:56 pm

You have to add it. By default it is blank.

Who is online

Users browsing this forum: No registered users and 70 guests