meta: rename legacy object module to 'ds'

This commit is contained in:
2025-08-09 19:57:42 +01:00
parent a5e3e06306
commit 0751ef469f
80 changed files with 460 additions and 460 deletions

29
ds/type.c Normal file
View File

@@ -0,0 +1,29 @@
#include "object.h"
#include <blue/core/queue.h>
#include <blue/ds/type.h>
#include <stdlib.h>
#include <string.h>
struct b_dsref *b_dsref_type_instantiate(const b_dsref_type *type)
{
if (!type || type->t_instance_size < sizeof(struct b_dsref)) {
return NULL;
}
struct b_dsref *out = malloc(type->t_instance_size);
if (!out) {
return NULL;
}
memset(out, 0x0, type->t_instance_size);
out->ob_ref = 1;
out->ob_type = type;
if (type->t_init) {
type->t_init(out);
}
return out;
}