---
# System prepended metadata

title: MTK issues

---

# MTK issues

```=C++
class Scheduler() {
    public:
        void schedule(input model?) {
            // 使用m_costFunc
        }
        
        void setCostFunc((class CostFunc or funcPtr) input) {
            costFunc = input;
        }
    
    private:
        CostFunc m_costFunc; // or funcPtr
        Model m_model; // ?
}

```

```=C++
struct C {
    // ...
    
    // my changes: add 2 uint and 2 ptr
    XX* x;
    unsigned int q;
    unsigned int w;
    YY* y;
}

struct A {
    struct B b;
    struct C c; // sizeof(C) changes in RT
    struct D d; // if sizeof(C) changed, ( a.d.member_of_d ) get incorrect addr
}

A a;

```

```
bp1: 
p sizeof(a.c) --> 192
p sizeof(C)   --> 192

bp2: 
p sizeof(a.c) --> 192
p sizeof(C)   --> 200
```


```=C++
typedef struct _A {
    int* data_section_1; // array to store loaded data
    int* data_section_2; // array to store loaded data
    ...
    
    unsigned int  data_section_1_loaded:1,
                  data_section_2_loaded:1,
                  data_section_3_loaded:1,
                  data_section_4_loaded:1,
                  data_section_5_loaded:1,
                  unused: 27;
} A;

void loadData1(A a) { 
    if (!a.data_section_1_loaded) {
        // open file, fill a.data_section_1
        a.data_section_1_loaded = 1;
    }
}

int findData1(A a) {
    loadData1(a);
    // find data and return
}

```

```=C++
typedef struct _S {
    int* A; // array to store loaded data
    int* B; // array to store loaded data
    ...
    
    unsigned int  A_loaded:1,
                  B_loaded:1,
                  C_loaded:1,
                  unused: 29;
} S;

void loadData_A(S s) { 
    if (!s.A_loaded) {
        // open file, fill s.A
        s.A_loaded = 1;
    }
}

int findData_A(S s) {
    loadData_A(s);
    // find data and return
}

```