Uploaded image for project: 'vpp'
  1. vpp
  2. VPP-1019

macro pool_get_aligned_will_expand return unexpectedly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Open
    • Icon: Medium Medium
    • None
    • None
    • VPPInfra
    • None

      {{#define pool_get_aligned_will_expand(P,YESNO,A) }}
      {{do { }}
      {{ pool_header_t * _pool_var (p) = pool_header (P); }}
      {{ uword _pool_var (l); }}
      {{ }}
      {{ _pool_var (l) = 0; }}
      {{ if (P) }}
      {{ { }}
      {{ if (_pool_var (p)->max_elts) }}
      {{ return 0; }}
      {{ _pool_var (l) = vec_len (_pool_var (p)->free_indices); }}
      {{ } }}
      {{ }}
      {{ /* Free elements, certainly won't expand */ }}
      {{ if (_pool_var (l) > 0) }}
      {{ YESNO=0; }}
      {{ else }}
      {{ { }}
      {{ /* Nothing on free list, make a new element and return it. */ }}
      {{ YESNO = _vec_resize_will_expand }}
      {{ (P, }}
      {{ /* length_increment */ 1, }}
      {{ /* new size */ (vec_len (P) + 1) * sizeof (P[0]), }}
      {{ pool_aligned_header_bytes, }}
      {{ /* align */ (A)); }}
      {{ } }}
      } while (0)

       

      If I write

      void foo()

      {

       //pool_get_aligned_will_expand()

      }

      foo could return unexpectedly.

            dbarach Dave Barach
            adoyee vincent wang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: