libk  Diff

Differences From Artifact [e8670496c8]:

To Artifact [09be45a2b3]:


     5      5   #ifndef KFclean
     6      6   #	define Kmsz(e) ( sizeof (e) / sizeof (e) [0] )
     7      7   #endif
     8      8   
     9      9   #ifdef __cplusplus
    10     10   extern "C" {
    11     11   #endif
           12  +
           13  +typedef enum kmcond {
           14  +	kmcond_ok,
           15  +	kmcond_bad_address,
           16  +} kmcond;
    12     17   
    13     18   typedef enum kmkind {
    14     19   	kmkind_none,
    15     20   	kmkind_heap,
    16     21   	kmkind_pool,
    17     22   	kmkind_ref,
    18     23   	kmkind_tree
................................................................................
    25     30   
    26     31   typedef struct kmcell {
    27     32   	kmkind kind;
    28     33   	sz size;
    29     34   	kmshred shred;
    30     35   	sz refs;
    31     36   	struct kmcell* src;
    32         -	char data[];
    33     37   } kmcell;
    34     38   
    35     39   typedef struct kmptr {
    36     40   	kmkind kind;
    37     41   	kmshred shred;
    38     42   	void* ref;
    39     43   	kmcell* cell;
    40     44   } kmptr;
    41     45   
    42     46   /* heap functions */
    43     47   
    44         -void* kmheapa(sz);
    45         -void  kmheapf(void*);
           48  +void*  kmheapa(sz);
           49  +kmcond kmheapf(void*);
    46     50   
    47     51   #ifdef __cplusplus
    48     52   }
    49     53   #endif
    50     54   
    51     55   #endif