From: George H. <geo...@us...> - 2013-12-09 19:34:40
|
Update of /cvsroot/win32forth/win32forth/src/kernel In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv22434 Modified Files: fkernel.f version.f Log Message: Tidied up memory allocation Index: fkernel.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/kernel/fkernel.f,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** fkernel.f 28 Nov 2013 19:28:18 -0000 1.99 --- fkernel.f 9 Dec 2013 19:34:37 -0000 1.100 *************** *** 3909,3916 **** \ 06/09/2002 21:54:51 arm major modifications ! \ [malloc_next][heapaddress][mem_type][ 0 ] [malloced_memory][extra_cells] ! \ | ! \ * returns this address on allocate * ! \ this is the "address" \ Changes: \ All memory calls are now to Windows heap functions --- 3909,3917 ---- \ 06/09/2002 21:54:51 arm major modifications ! \ [malloc_next][heapaddress][mem_type][ 0/class ] [malloced_memory][extra_cells] ! \ ^ | ! \ contains 0 for allcated memory * returns this address on allocate * ! \ class pointer for objects this is the "address" ! \ created with new> see class.f \ Changes: \ All memory calls are now to Windows heap functions *************** *** 3999,4003 **** if drop 0 TRUE \ error, fl=true else dup malloc-add-link \ link in ! link>mem FALSE \ point at real mem then ; \ -- f1 = true on error --- 4000,4005 ---- if drop 0 TRUE \ error, fl=true else dup malloc-add-link \ link in ! link>mem 0 over cell- ! \ point at real mem and zero preceeding cell ! FALSE then ; \ -- f1 = true on error *************** *** 4005,4009 **** allocate THROW_MEMALLOCFAIL ?THROW ; ! |: (free) ( link-addr -- f1 ) \ free memory (addr points link) dup malloc-unlink \ first, delete from malloc list if drop TRUE \ if it failed, return failure --- 4007,4013 ---- allocate THROW_MEMALLOCFAIL ?THROW ; ! : free ( addr -- f1 ) \ release the memory pointer ! \ f1=TRUE=failed, f1=FALSE=ok ! mem>link \ point at true address dup malloc-unlink \ first, delete from malloc list if drop TRUE \ if it failed, return failure *************** *** 4011,4023 **** then ; - : free ( addr -- f1 ) \ release the memory pointer - \ f1=TRUE=failed, f1=FALSE=ok - mem>link (free) ; \ point at true address - - |: (release) ( link-addr -- ) \ release block - (free) THROW_MEMRELFAIL ?THROW ; ! : release ( addr -- ) ! mem>link (release) ; : realloc ( u addr -- addr' fl ) --- 4015,4021 ---- then ; ! : release ( addr -- ) \ release block ! free THROW_MEMRELFAIL ?THROW ; : realloc ( u addr -- addr' fl ) *************** *** 4049,4064 **** |: init-malloc ( -- ) - \ NOTE the two deferred words MUST BE reset to Noop's before any mallocs - ['] noop is (memlock) \ turn off lock until inited - ['] noop is (memunlock) \ turn off unlock until inited - 0 malloc-link ! call GetProcessHeap malloc-haddr ! ; \ heap address save in var - (( - |: term-malloc ( -- ) \ release all allocated memory - ['] (release) malloc-link do-link - ; - )) - \ -------------------- ANS File Functions -------------------- --- 4047,4052 ---- Index: version.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/kernel/version.f,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** version.f 21 Jul 2013 00:24:17 -0000 1.23 --- version.f 9 Dec 2013 19:34:37 -0000 1.24 *************** *** 3,7 **** cr .( Loading META version info) ! 61503 VALUE #VERSION# \ Change only the version number above; the build number is automatically assigned. --- 3,8 ---- cr .( Loading META version info) ! 61503 VALUE #VERSION# ! \ 70000 VALUE #VERSION# \ For future V7.xx.xx testing \ Change only the version number above; the build number is automatically assigned. |