File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 4747#define IA2_POST_CONDITION_FOR (target_func ) __attribute__((annotate("ia2_post_condition:" #target_func)))
4848
4949/// Mark the annotated function as a constructor for the type `T`,
50- /// where the function has the signature `R f(T*, ...)`.
50+ /// where the function has the signature `R f(T* this , ...)`.
5151/// The `...` aren't varargs here; it just means that
5252/// there can be any number of extra args after the `T*`.
5353///
54+ /// This function should initialize the `T*`
55+ /// and marks the start of its lifetime as a
56+ /// registered and valid ptr of type `T`.
57+ ///
5458/// Note that this is not the same as `__attribute__((constructor))`.
5559#define IA2_CONSTRUCTOR __attribute__((annotate("ia2_constructor")))
5660
5761/// Mark the annotated function as a destructor for the type `T`,
58- /// where the function has the signature `void f(T*)`.
62+ /// where the function has the signature `void f(T* this)`.
63+ ///
64+ /// This function should unitialize the `T*`
65+ /// and marks the end of its lifetime as a
66+ /// registered and valid ptr of type `T`.
5967///
6068/// Note that this is not the same as `__attribute__((destructor))`.
6169#define IA2_DESTRUCTOR __attribute__((annotate("ia2_destructor")))
Original file line number Diff line number Diff line change @@ -8,13 +8,13 @@ RUN: cat dav1d_call_gates_1.ld | FileCheck --check-prefix=LINKARGS %s
88#define IA2_COMPARTMENT 2
99#include <ia2_compartment_init.inc>
1010
11- IA2_CONSTRUCTOR
11+ IA2_CONSTRUCTOR // Registers that ptr `this` has type `Dav1dContext` now.
1212int dav1d_open (Dav1dContext * const this , const Dav1dSettings * const s ) {
1313 // Initialize `this`; implementation omitted.
1414 return 0 ;
1515}
1616
17- IA2_DESTRUCTOR
17+ IA2_DESTRUCTOR // Registers that ptr `this` no longer has type `Dav1dContext`.
1818void dav1d_close (Dav1dContext * const this ) {
1919 // Uninitialize `this`; implementation omitted.
2020}
You can’t perform that action at this time.
0 commit comments