Differences From Artifact [cc32756862]:
- File kmem/free.fn.c — part of check-in [a8d93823f1] at 2019-08-18 13:42:35 on branch trunk — add functions, generate C syscall table (user: lexi, size: 524) [annotate] [blame] [check-ins using]
- File mod/kmem/free.fn.c — part of check-in [14172a910a] at 2019-08-21 06:00:24 on branch trunk — move modules to a subdirectory in order to keep the directory tree organized and make room for OS-specific build files (user: lexi, size: 524) [annotate] [blame] [check-ins using]
To Artifact [bac849b7ff]:
- File mod/kmem/free.fn.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: 526) [annotate] [blame] [check-ins using]
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
* kmfree() frees memory allocated in any manner.
* it ignores non-dynamically allocated memory,
* returning kmcond_unnecessary. to check for
* success, compare result < kmcond_fail.
*/
kmcond kmfree(kmptr ptr) {
if (ptr.kind <= kmkind_fail) return kmcond_unnecessary;
switch (ptr.kind) {
case kmkind_heap: return kmheapf(ptr.ref);
}
return kmcond_unhandled;
}
|
| |
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
* kmfree() frees memory allocated in any manner.
* it ignores non-dynamically allocated memory,
* returning kmcond_unnecessary. to check for
* success, compare result < kmcond_fail.
*/
kmcond kmfree(kmptr ptr) {
if (ptr.kind <= kmkind_broken) return kmcond_unnecessary;
switch (ptr.kind) {
case kmkind_heap: return kmheapf(ptr.ref);
}
return kmcond_unhandled;
}
|