Remove alloc_*() Functions
This commit is contained in:
parent
eca52455c3
commit
603010e3cc
@ -220,6 +220,12 @@ export class Struct {
|
||||
out += `struct ${this.#name} {\n`;
|
||||
out += this.#generateProperties();
|
||||
out += this.#generateMethods();
|
||||
if (this.#size === null) {
|
||||
// Prevent Manually Copying/Allocating Structure With Undefined
|
||||
out += `${INDENT}${this.#name}() = delete;\n`;
|
||||
out += `${INDENT}${this.#name}(const ${this.#name} &) = delete;\n`;
|
||||
out += `${INDENT}${this.#name} &operator=(const ${this.#name} &) = delete;\n`;
|
||||
}
|
||||
out += `};\n`;
|
||||
|
||||
// Sanity Check Offsets
|
||||
@ -235,11 +241,6 @@ export class Struct {
|
||||
out += assertSize(this.#name, this.#size);
|
||||
}
|
||||
|
||||
// Allocation Function
|
||||
if (this.#size !== null) {
|
||||
out += `${this.#name} *alloc_${this.#name}();\n`;
|
||||
}
|
||||
|
||||
// Return
|
||||
return out;
|
||||
}
|
||||
@ -272,13 +273,6 @@ export class Struct {
|
||||
init += vtable.init;
|
||||
}
|
||||
|
||||
// Allocation Function
|
||||
if (this.#size !== null) {
|
||||
declarations += `${this.#name} *alloc_${this.#name}() {\n`;
|
||||
declarations += `${INDENT}return new ${this.#name};\n`;
|
||||
declarations += '}\n';
|
||||
}
|
||||
|
||||
// Return
|
||||
return {functions: declarations, init};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user