GCC Wikia
Advertisement

このページを編集する際は,編集に関する方針に従ってください.[]

概要[]

引数[]

  • OBSTACK

実装[]

 obstack.h
295: #if defined __GNUC__ && defined __STDC__ && __STDC__
~
  419: /* The local variable is named __o1 to avoid a name conflict
  420:    when obstack_blank is called.  */
421: # define obstack_finish(OBSTACK)                                        \
422: __extension__                                                           \
423: ({ struct obstack *__o1 = (OBSTACK);                                    \
424:    void *value;                                                         \
 アドレスの退避
425:    value = (void *) __o1->object_base;                                  \
426:    if (__o1->next_free == value)                                        \
427:      __o1->maybe_empty_object = 1;                                      \
 next_freeの切り上げだと思う
428:    __o1->next_free                                                      \
429:      = __INT_TO_PTR ((__PTR_TO_INT (__o1->next_free)+__o1->alignment_mask)\
430:                      & ~ (__o1->alignment_mask));                     \
 切り上げた結果により限界を超えてしまったときの処理
431:    if (__o1->next_free - (char *)__o1->chunk                            \
432:        > __o1->chunk_limit - (char *)__o1->chunk)                       \
433:      __o1->next_free = __o1->chunk_limit;                               \
434:    __o1->object_base = __o1->next_free;                                 \
435:    value; })
~
445: #else /* not __GNUC__ or not __STDC__ */
~
518: # define obstack_finish(h)                                              \
519: ( ((h)->next_free == (h)->object_base                                   \
520:    ? (((h)->maybe_empty_object = 1), 0)                                 \
521:    : 0),                                                                \
522:   (h)->temp = __PTR_TO_INT ((h)->object_base),                          \
523:   (h)->next_free                                                        \
524:     = __INT_TO_PTR ((__PTR_TO_INT ((h)->next_free)+(h)->alignment_mask) \
525:                     & ~ ((h)->alignment_mask)),                               \
526:   (((h)->next_free - (char *) (h)->chunk                                \
527:     > (h)->chunk_limit - (char *) (h)->chunk)                           \
528:    ? ((h)->next_free = (h)->chunk_limit) : 0),                          \
529:   (h)->object_base = (h)->next_free,                                    \
530:   __INT_TO_PTR ((h)->temp))
~
539: #endif /* not __GNUC__ or not __STDC__ */


リンク元

Advertisement