예제 #1
0
struct item* create_dll(void)
{
    struct item *dll = alloc_and_zero();
    struct item *now = dll;

    // NOTE: running this on bare metal may cause the machine to swap a bit
    int i;
    for (i = 1; i; ++i) {
        now->next = alloc_and_zero();
        now->next->prev = now;
        now = now->next;
    }

    return dll;
}
예제 #2
0
파일: test-0058.c 프로젝트: Orwel/forester
struct item* create_item(struct item *end)
{
    struct item *pi = alloc_and_zero();
    pi->prev = end;
    end->next = pi;
    return pi;
}
예제 #3
0
파일: test-0058.c 프로젝트: Orwel/forester
struct item* create_dll(void)
{
    struct item *dll = alloc_and_zero();
    struct item *pi = create_item(dll);
    pi = create_item(pi);
    pi = create_item(pi);
    pi = create_item(pi);
    pi = create_item(pi);
    pi = create_item(pi);
    return dll;
}
예제 #4
0
struct item* create_dll(void)
{
    struct item *dll = alloc_and_zero();
    dll = create_dll_item(dll);
    dll = create_dll_item(dll);
    dll = create_dll_item(dll);
    dll = create_dll_item(dll);

    // NOTE: running this on bare metal may cause the machine to swap a bit
    int i;
    for (i = 1; i; ++i)
        dll = create_dll_item(dll);

    //___sl_plot(NULL);
    return dll;
}
예제 #5
0
struct item* create_dll_item(struct item *dll)
{
    dll->next = alloc_and_zero();
    dll->next->prev = dll;
    return dll->next;
}