Uploaded image for project: 'Qpid Dispatch'
  1. Qpid Dispatch
  2. DISPATCH-1299

Provide API access to the already existing safe-reference capability in alloc-pool

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.6.0
    • Component/s: Container
    • Labels:
      None

      Description

      This improvement adds the following two functions to the list of functions generated per pooled type:

      typedef ... <typename>_sp;
      void set_safe_ptr(<typename> *p, <typename>_sp *sp);
      <typename> *safe_deref_<typename>(<typename>_sp sp);

      A user of this feature can declare or allocate a safe-pointer, set the safe-pointer using a normal object pointer, and dereference the safe-pointer later to yield the original normal pointer.  If, in the interim time, the object was freed, the safe-dereference will yield a NULL pointer rather than a stale (possibly re-used) pointer.

        Attachments

          Activity

            People

            • Assignee:
              tedross Ted Ross
              Reporter:
              tedross Ted Ross
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: