diff --git a/programs/bcc32/include/kos_func.inc b/programs/bcc32/include/kos_func.inc index fd420deea1..07124ad8b0 100644 --- a/programs/bcc32/include/kos_func.inc +++ b/programs/bcc32/include/kos_func.inc @@ -101,19 +101,11 @@ end if movsd Kolibri_Put_MovEaxVal_Ret @Kolibri@GetPid$qv,edx if defined KolibriHeapInit - mov ecx,esp - push ebx - push ecx - push U_END - call KolibriHeapInit ; Initialize a dynamic heap and create new memory in its begin. - pop ecx ; Parameters: begin of a new heap, end of data to create in - mov [esp+4],eax ; the begin of a heap. Return address of the created data. - mov dword [esp],0 -else + call KolibriHeapInit ; Initialize a dynamic heap +end if xor eax,eax push eax push eax -end if call @Kolibri@ThreadMain$qpvt1 .ThreadFinish: add esp,8 diff --git a/programs/bcc32/include/kos_heap.h b/programs/bcc32/include/kos_heap.h index 8696df8715..bf63ae8bfd 100644 --- a/programs/bcc32/include/kos_heap.h +++ b/programs/bcc32/include/kos_heap.h @@ -2,31 +2,15 @@ #define __KOLIBRI_HEAP_H_INCLUDED_ #include "kolibri.h" -#include "memheap.h" // Kolibri memory heap interface. namespace Kolibri // All kolibri functions, types and data are nested in the (Kolibri) namespace. { - long _HeapInit() - { - return MemoryHeap::mem_Init(); - } - - void *Alloc(unsigned int size) - { - return MemoryHeap::mem_Alloc(size); - } - - void *ReAlloc(void *mem, unsigned int size) - { - return MemoryHeap::mem_ReAlloc(size, mem); - } - - void Free(void *mem) - { - MemoryHeap::mem_Free(mem); - } + long HeapInit(); + void *Alloc(unsigned long int size); + void *ReAlloc(void *mem, unsigned long int size); + void Free(void *mem); } #endif // ndef __KOLIBRI_HEAP_H_INCLUDED_ diff --git a/programs/bcc32/include/kos_heap.inc b/programs/bcc32/include/kos_heap.inc index 3aa69d94c2..2d64588a20 100644 --- a/programs/bcc32/include/kos_heap.inc +++ b/programs/bcc32/include/kos_heap.inc @@ -1,37 +1,42 @@ ;/*** -KolibriHeapInit = @@Kolibri@_HeapInit$qv +KolibriHeapInit = @Kolibri@HeapInit$qv -KolibriHeapAlloc = @@Kolibri@Alloc$qui +KolibriHeapAlloc = @Kolibri@Alloc$qul -KolibriHeapReAlloc = @@Kolibri@ReAlloc$qpvui +KolibriHeapReAlloc = @Kolibri@ReAlloc$qpvul -KolibriHeapFree = @@Kolibri@Free$qpv +KolibriHeapFree = @Kolibri@Free$qpv -proc @MemoryHeap@mem_Init$qv uses ebx +align 4 +proc @Kolibri@HeapInit$qv uses ebx mov eax,SF_SYS_MISC mov ebx,SSF_HEAP_INIT int 0x40 ret endp -proc @MemoryHeap@mem_Alloc$qul uses ebx +align 4 +proc @Kolibri@Alloc$qul uses ebx mov eax,SF_SYS_MISC mov ebx,SSF_MEM_ALLOC + mov ecx,[esp+8] int 0x40 ret endp -proc @MemoryHeap@mem_ReAlloc$qulpv uses ebx +align 4 +proc @Kolibri@ReAlloc$qpvul uses ebx mov eax,SF_SYS_MISC mov ebx,SSF_MEM_REALLOC - mov ecx,[esp+8] - mov edx,[esp+12] + mov ecx,[esp+12] + mov edx,[esp+8] int 0x40 ret endp -proc @MemoryHeap@mem_Free$qpv uses ebx +align 4 +proc @Kolibri@Free$qpv uses ebx mov eax,SF_SYS_MISC mov ebx,SSF_MEM_FREE mov ecx,[esp+8] diff --git a/programs/bcc32/include/memheap.h b/programs/bcc32/include/memheap.h deleted file mode 100644 index 52a06f887d..0000000000 --- a/programs/bcc32/include/memheap.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef __MEMORY_HEAP_H_INCLUDED_ -#define __MEMORY_HEAP_H_INCLUDED_ - -namespace MemoryHeap -{ - long mem_Init(); - void *mem_Alloc(unsigned long size); - void *mem_ReAlloc(unsigned long size, void *mem); - bool mem_Free(void *mem); -} - -#endif // ndef __MEMORY_HEAP_H_INCLUDED_ -