39 lines
1.4 KiB
C
39 lines
1.4 KiB
C
/*
|
|
* This code is part of the programming language flup
|
|
* flup comes with ABSOLUTELY NO WARRANTY and is licensed under AGPL-3.0 or later.
|
|
* Copyright (C) 2024 VegOwOtenks
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* as published by the Free Software Foundation; either version 2
|
|
* of the License, or (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
*/
|
|
#ifndef FLUP_OBJECT_H
|
|
#define FLUP_OBJECT_H
|
|
|
|
#include "object-type.h"
|
|
#include "../submodules/utilitiec/src/TracingHeap/TracingHeap.h"
|
|
|
|
struct Object_s {
|
|
struct Object_s* next; // linked list of all objects
|
|
ObjectType* type;
|
|
union ValueContent attributes[];
|
|
};
|
|
|
|
size_t Object_AllocationSizeForType(ObjectType* otype);
|
|
|
|
// No-op
|
|
int Object_Destroy(void* arg, Object* o);
|
|
size_t Object_SizeQuery(void* arg, Object* o);
|
|
int Object_ReferenceTrace(void* context, Object* data, TracingHeapVisit trace_callback, void* callback_context);
|
|
|
|
#endif
|