Differences From Artifact [2c9c964882]:
- File mod/kcore/testbin.exe.c — part of check-in [acb4a9944e] at 2019-08-22 08:44:29 on branch trunk — add kmlini() and kmlina() functions; restructure allocation functions to work more reasonably (returning a tuple struct instead of making a user pass in a void**); update docs accordingly (user: lexi, size: 565) [annotate] [blame] [check-ins using]
To Artifact [175e42b805]:
- File mod/kcore/testbin.exe.c — part of check-in [f37ee769c9] at 2019-08-22 08:52:25 on branch trunk — add tests for linear allocators, fix dumb bug in kmheapf() that caused it to return an error on success (user: lexi, size: 733) [annotate] [blame] [check-ins using]
26 27 28 29 30 31 32 33 34 |
if (alloc.cond != kmcond_ok) return kbad_mem; void* region = alloc.raw; kmzero(region,2048); if (kmheapf(region) >= kmcond_fail) return kbad_mem; return kbad_ok; } |
> > > > > > > |
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
if (alloc.cond != kmcond_ok) return kbad_mem; void* region = alloc.raw; kmzero(region,2048); if (kmheapf(region) >= kmcond_fail) return kbad_mem; void* top = kmlini(); kmres rst = kmlina(1230); if(rst.cond != kmcond_ok) return kbad_mem; kmres rst2 = kmlina(789); if(rst2.cond != kmcond_ok) return kbad_mem; return kbad_ok; } |