libk  Diff

Differences From Artifact [cc32756862]:

To Artifact [bac849b7ff]:


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;
}