Page 1 of 1

explain the mem_assert macro to me

Posted: Tue May 07, 2019 4:40 pm
by manoj15
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 ?

Re: explain this to me

Posted: Wed May 08, 2019 4:24 am
by WiFive
By default it doesn't do anything but seems intended for throwing an exception similar to ESP_ERROR_CHECK for debugging

Re: explain the mem_assert macro to me

Posted: Sun May 12, 2019 12:15 pm
by manoj15
where's the statement if it's to throw some exception?

Re: explain the mem_assert macro to me

Posted: Sun May 12, 2019 7:56 pm
by WiFive
You have to add it. By default it is blank.