Skip to content

Commit

Permalink
Merge pull request #6 from jlongster/master
Browse files Browse the repository at this point in the history
Remove confusing heap allocation procedures
  • Loading branch information
jdiez17 committed Apr 23, 2012
2 parents e55fce4 + 1b4268b commit e7eb89d
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions text-io/misc_cstring.dasm
Expand Up @@ -86,32 +86,3 @@ JSR strcpy_FUNCTION
BRK
;DCPUC ENDFUNCTION

;DCPUC STATIC
:DCPUC_MR_HEAPHEAD DAT 0x0
:DCPUC_MR_HEAPEND DAT 0x0
:DCPUC_MR_HEAPFREE DAT 0x0
:DCPUC_MR_OUTOFMEMORYERROR DAT "Fatal Error: out of memory" 0x0
;DCPUC END

;DCPUC FUNCTION init_mrheap dcpuc_init_mrheap 2 *memstart, *memend
;Initializes a mark-and-release heap from memstart to memend
:dcpuc_init_mrheap
SET [DCPUC_MR_HEAPHEAD], A
SET [DCPUC_MR_HEAPFREE], A
SET [DCPUC_MR_HEAPEND], B
SET PC, POP
;DCPUC END

;DCPUC FUNCTION mrmalloc dcpuc_mrmalloc 1 length
;Returns address of free block of size length
:dcpuc_mrmalloc
SET C, [DCPUC_MR_HEAPFREE]
ADD [DCPUC_MR_HEAPFREE], A
IFG [DCPUC_MR_HEAPEND], [DCPUC_MR_HEAPFREE]
SET PC, DCPUC_MRMALLOC_0
SET A, DCPUC_MR_OUTOFMEMORYERROR
JSR dcpuc_abort ;Never returns
:DCPUC_MRMALLOC_0
SET A, C
SET PC, POP
;DCPUC END

0 comments on commit e7eb89d

Please sign in to comment.