/programs/demos/life2/include/memheap.h |
---|
File deleted |
/programs/demos/life2/include/kos_func.inc |
---|
101,19 → 101,11 |
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 |
/programs/demos/life2/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(); |
long HeapInit(); |
void *Alloc(unsigned long int size); |
void *ReAlloc(void *mem, unsigned long int size); |
void Free(void *mem); |
} |
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); |
} |
} |
#endif // ndef __KOLIBRI_HEAP_H_INCLUDED_ |
/programs/demos/life2/include/kos_heap.inc |
---|
1,14 → 1,15 |
;/*** |
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 |
15,23 → 16,27 |
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] |
/programs/demos/life2/kos_cdlg.inc |
---|
16,7 → 16,7 |
mov esi,ecx |
.open_file_dlg_alloc: |
push esi |
call @@Kolibri@Alloc$qui |
call @Kolibri@Alloc$qul |
pop ecx |
test eax,eax |
jz .open_file_dlg_ret |
97,7 → 97,7 |
push eax |
push esi |
push dword [esp+8] |
call @@Kolibri@ReAlloc$qpvui |
call @Kolibri@ReAlloc$qpvul |
add esp,8 |
mov ecx,eax |
pop eax |
131,7 → 131,7 |
mov [esp+8],eax |
push eax |
push dword [esp+4] |
call @@Kolibri@ReAlloc$qpvui |
call @Kolibri@ReAlloc$qpvul |
add esp,8 |
test eax,eax |
jz .open_file_dlg_end |
143,12 → 143,12 |
mov ebx,[esp+20] |
mov dword [ebx],2 |
push dword [ebx+4] |
call @@Kolibri@Free$qpv |
call @Kolibri@Free$qpv |
pop ecx |
mov [ebx+4],esi |
jmp .open_file_dlg_invalidate |
.open_file_dlg_end: |
call @@Kolibri@Free$qpv |
call @Kolibri@Free$qpv |
add esp,12 |
mov ebx,[esp+20] |
mov dword [ebx],1 |