[SOLVED] SetObjName after object release

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] SetObjName after object release

    Hello,
    I like Human readable object identifiers, it helps it many cases to identify objects. But what happens after I delete the object with the name? What should I do with the memory of OS_OBJNAME ?

    For ex.,
    OS_MAILBOX_Create(&Mailbox, 10, 10, &Buffer);

    MailboxName = OS_malloc(sizeof(OS_OBJNAME));
    OS_DEBUG_SetObjName(MailboxName, &Mailbox, "My Mailbox");
    ...
    OS_MAILBOX_Delete(&Mailbox);
    What should I do with the MailboxName ? Is it safe to simply do OS_free(MailboxName)?
  • Dear Vakaras,

    Thank you for your inquiry. Calling free() on MailboxName is not possible at this particular time.
    It may, however, be reassigned for any other object by calling OS_DEBUG_SetObjName() on MailboxName again.

    Please let me know if I can be of any further help.

    Best regards,
    Martin
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Dear Vakaras,

    I'm glad to announce that the requested functionality will be included with upcoming versions of embOS. That is, V5.06 and later will include a OS_DEBUG_RemoveObjName() function, which may then be used in combination with e.g. OS_free(MailboxName).

    Best regards,
    Martin
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.