Try   HackMD

2021q1 Homework4 (refinement)

contributed by < ccs100203 >

tags: linux2021

J09: refinement

問題整理

  • 在 qui3 中遇到的 xs_tmp,其中包含的 struct 用途未搞懂

目前還是搞不懂為什麼 _Static_assert 需要包裝在一個 struct 裡面

/* Memory leaks happen if the string is too long but it is still useful for
 * short strings.
 */
#define xs_tmp(x)                                                   \
    ((void) ((struct {                                              \
         _Static_assert(sizeof(x) <= MAX_STR_LEN, "it is too big"); \
         int dummy;                                                 \
     }){1}),                                                        \
     xs_new(&xs_literal_empty(), x))
  • quiz4 中對於 pthread 以及 lock 的掌握度低 (已經搞懂)

  • 非遞迴版本 INTROSORT 的轉換時機 (無 MAX_LEVEL)