/* This use case demonstrates that the dynamically allocated memory is out of use and aos_realloc is called to expand the memory.  */
void mem_realloc(void)
/* This use case demonstrates that the dynamically allocated memory is out of use and aos_realloc is called to expand the memory.  */
void mem_realloc(void)
{
    struct message *old_ptr = NULL, *new_ptr = NULL;
    old_ptr = (struct message *)aos_malloc(sizeof(struct message) * 4);
    if (old_ptr == NULL) {
        printf("[%s]aos_malloc error\n", MODULE_NAME);
        return;
    }
    memset(old_ptr, 0, sizeof(struct message) * 4);
    new_ptr = aos_realloc(old_ptr, sizeof(struct message) * 6);
    if (new_ptr == NULL) {
        aos_free(old_ptr);
        old_ptr= NULL;
        printf("[%s]aos_realloc task1 error\n", MODULE_NAME);
        return;
    }
    printf("[%s]aos_realloc success!\n", MODULE_NAME);
    aos_free(new_ptr);
    new_ptr = NULL;
}