compilation error fix and added the ability to build a runtime using an external heap object

This commit is contained in:
cozis
2022-01-21 13:49:02 +01:00
parent 2a0af0f9bd
commit dc5586e94c
2 changed files with 37 additions and 35 deletions
+4 -2
View File
@@ -111,6 +111,8 @@ Object *Object_SliceBuffer(Object *buffer, int offset, int length, Heap *heap, E
return NULL;
}
BufferSliceObject *slice;
if(buffer->type == &t_buffer)
{
BufferObject *original = (BufferObject*) buffer;
@@ -118,7 +120,7 @@ Object *Object_SliceBuffer(Object *buffer, int offset, int length, Heap *heap, E
if(offset == 0 && length == original->size)
return buffer;
BufferSliceObject *slice = (BufferSliceObject*) Heap_Malloc(heap, &t_buffer_slice, error);
slice = (BufferSliceObject*) Heap_Malloc(heap, &t_buffer_slice, error);
if(slice == NULL)
return NULL;
@@ -149,7 +151,7 @@ Object *Object_SliceBuffer(Object *buffer, int offset, int length, Heap *heap, E
{
assert(buffer->type == &t_buffer_slice);
BufferSliceObject *slice = (BufferSliceObject*) Heap_Malloc(heap, &t_buffer_slice, error);
slice = (BufferSliceObject*) Heap_Malloc(heap, &t_buffer_slice, error);
if(slice == NULL)
return NULL;