Changeset 961c0484 in mainline for kernel/generic/include/lib/ra.h
- Timestamp:
- 2011-12-04T22:33:03Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b4e59b3
- Parents:
- 375fc3f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/lib/ra.h
r375fc3f r961c0484 45 45 46 46 typedef struct { 47 link_t span_link; /**< Link for the arena's list of spans. */47 link_t span_link; /**< Arena's list of spans link. */ 48 48 49 49 list_t segments; /**< List of span's segments. */ … … 53 53 54 54 hash_table_t used; 55 56 uintptr_t base; /**< Span base. */ 57 size_t size; /**< Span size. */ 55 58 } ra_span_t; 56 59 60 /* 61 * We would like to achieve a good ratio of the size of one unit of the 62 * represented resource (e.g. a page) and sizeof(ra_segment_t). We therefore 63 * attempt to have as few redundant information in the segment as possible. For 64 * example, the size of the segment needs to be calculated from the segment 65 * base and the base of the following segment. 66 */ 57 67 typedef struct { 58 link_t segment_link; /**< Link for the span's list of segments. */ 59 link_t free_link; /**< Link for the span's free list. */ 60 link_t used_link; /**< Link for the span's used hash table. */ 68 link_t segment_link; /**< Span's segment list link. */ 69 link_t fu_link; /**< Span's free list or used hash link. */ 61 70 62 71 uintptr_t base; /**< Segment base. */ 63 uintptr_t size; /**< Segment size. */64 65 72 } ra_segment_t; 66 73 67 74 extern ra_arena_t *ra_arena_create(uintptr_t, size_t); 68 extern voidra_span_add(ra_arena_t *, uintptr_t, size_t);75 extern bool ra_span_add(ra_arena_t *, uintptr_t, size_t); 69 76 extern uintptr_t ra_alloc(ra_arena_t *, size_t, size_t); 70 77 extern void ra_free(ra_arena_t *, uintptr_t, size_t);
Note:
See TracChangeset
for help on using the changeset viewer.