[okl4-developer] Strange thing in “pingpong“ example

Alexander Valitov valitov79 at mail.ru
Thu Jan 15 19:26:37 EST 2009


Hello all,

Now I’m playing around with OKL4 3.0. I’ve been trying to get into details
of pingpong example and have found one strange thing that I do not
understand.

It is about variables in main() function defined as:
  struct okl4_utcb_item *utcb_item[THREADS];
  struct okl4_kcap_item *kcap_item[THREADS];

They are array of pointers to “kind of descriptors” for allocated UTCB and
KCAP objects. For each element of array corresponding malloc() function is
called allocating memory for descriptor from heap. Size of descriptors is
about 4 bytes. So each call to malloc() allocates 4 bytes.



More information about the Developer mailing list