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 4343#define IA2_POST_CONDITION_FOR (target_func ) __attribute__((annotate("ia2_post_condition:" #target_func)))
4444
4545/// Mark the annotated function as a constructor for the type `T`,
46- /// where the function has the signature `R f(T*, ...)`.
46+ /// where the function has the signature `R f(T* this , ...)`.
4747/// The `...` aren't varargs here; it just means that
4848/// there can be any number of extra args after the `T*`.
4949///
50+ /// This function should initialize the `T*`
51+ /// and marks the start of its lifetime as a
52+ /// registered and valid ptr of type `T`.
53+ ///
5054/// Note that this is not the same as `__attribute__((constructor))`.
5155#define IA2_CONSTRUCTOR __attribute__((annotate("ia2_constructor")))
5256
5357/// Mark the annotated function as a destructor for the type `T`,
54- /// where the function has the signature `void f(T*)`.
58+ /// where the function has the signature `void f(T* this)`.
59+ ///
60+ /// This function should unitialize the `T*`
61+ /// and marks the end of its lifetime as a
62+ /// registered and valid ptr of type `T`.
5563///
5664/// Note that this is not the same as `__attribute__((destructor))`.
5765#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