libk  Diff

Differences From Artifact [f1bdb07ea2]:

To Artifact [5796abefa5]:


     1      1   #include <k/core.h>
     2      2   #include <k/mem.h>
     3      3   #include <k/io.h>
     4      4   #include <k/magic.h>
            5  +
            6  +struct object {
            7  +	u8 a;
            8  +	s16 b;
            9  +	bool c;
           10  +};
     5     11   
     6     12   kbad entry(kenv e) {
     7     13   	const char msg[] = "hello from libk\n";
     8     14   	ksraw ptr = { Kmsz(msg), msg };
     9     15   
    10     16   	bool maybe = true;
    11     17   	maybe = no;
    12     18   
    13     19   	if (kiosend(e.std, ptr, null) == kiocond_ok) {
    14         -		return kbad_ok;
           20  +		/* great, continue */
    15     21   	} else {
    16     22   		return kbad_io;
    17     23   	}
           24  +
           25  +	struct object* block = kmheapa(sizeof (struct object) * 4);
           26  +	if (block == null) return kbad_mem; else return kbad_ok;
           27  +	
           28  +	block[1].a = 5;
           29  +
           30  +	return kbad_ok;
    18     31   }