Changeset 1b5c81ed


Ignore:
Timestamp:
Jun 30, 2016, 4:20:53 PM (8 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
f80e0218
Parents:
34b76a8
Message:

fixed several compilation errors

Location:
src/examples/gc_no_raii/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/examples/gc_no_raii/src/internal/globals.h

    r34b76a8 r1b5c81ed  
    1616// static const size_t OBJECT_PTR_MASK = ~(OBJECT_ALLIGNMENT - 1);
    1717
     18enum {
     19        POOL_SIZE_EXP   = 24,
     20        POOL_SIZE_BYTES         = 0x1 << POOL_SIZE_EXP,
     21        POOL_PTR_MASK   = ~(POOL_SIZE_BYTES - 1),
    1822
    19 #define POOL_SIZE_EXP 24
    20 #define POOL_SIZE_BYTES 0x1 << POOL_SIZE_EXP
    21 #define POOL_PTR_MASK ~(POOL_SIZE_BYTES - 1)
     23        CARDS_SIZE_EXP  = 12,
     24        CARDS_SIZE_BYTES        = 0x1 << CARDS_SIZE_EXP,
     25        CARDS_OFFSET_MASK       = (~(CARDS_SIZE_BYTES - 1)) & (POOL_SIZE_BYTES - 1),
     26        CARDS_COUNT     = POOL_SIZE_BYTES / CARDS_SIZE_BYTES,
    2227
    23 #define CARDS_SIZE_EXP 12
    24 #define CARDS_SIZE_BYTES 0x1 << CARDS_SIZE_EXP
    25 #define CARDS_OFFSET_MASK (~(CARDS_SIZE_BYTES - 1)) & (POOL_SIZE_BYTES - 1)
    26 #define CARDS_COUNT POOL_SIZE_BYTES / CARDS_SIZE_BYTES
    27 
    28 #define OBJECT_ALLIGNMENT sizeof(size_t)
    29 #define OBJECT_PTR_MASK ~(OBJECT_ALLIGNMENT - 1)
     28        OBJECT_ALLIGNMENT       = sizeof(size_t),
     29        OBJECT_PTR_MASK         = ~(OBJECT_ALLIGNMENT - 1),
     30};
  • src/examples/gc_no_raii/src/internal/object_header.h

    r34b76a8 r1b5c81ed  
    11#pragma once
    22
     3#include <stdbool.h>
    34#include <stddef.h>
    45#include <stdint.h>
  • src/examples/gc_no_raii/src/internal/state.c

    r34b76a8 r1b5c81ed  
    2626#endif
    2727
     28static gc_state s;
     29
    2830gc_state* gc_get_state()
    2931{
    30         static gc_state s;
    3132        if(!s.is_initialized) ctor(&s);
    3233        return &s;
  • src/examples/gc_no_raii/src/vector.c

    r34b76a8 r1b5c81ed  
    6464inline void realloc(heap_allocator(T) *const this, size_t size)
    6565{
    66         static const size_t GROWTH_RATE = 2;
     66        enum { GROWTH_RATE = 2 };
    6767        if(size > this->capacity)
    6868        {
Note: See TracChangeset for help on using the changeset viewer.