~jb55/polyadvent

1cbe79dc0f73f308b51330fa97b9bdc613884d16 — William Casarin 1 year, 7 months ago 7ad510b
add resource debug

Signed-off-by: William Casarin <jb55@jb55.com>
1 files changed, 3 insertions(+), 1 deletions(-)

M src/resource.c
M src/resource.c => src/resource.c +3 -1
@@ 168,8 168,10 @@ void *new_resource(struct resource_manager *r, struct resource_id *id)

    struct resource_id *fresh_id;

    if (r->resource_count + 1 > r->max_capacity)
    if (r->resource_count + 1 > r->max_capacity) {
        printf("new_resource: count %d > max cap %d\n", r->resource_count, r->max_capacity);
        return NULL;
    }

    if (r->resource_count + 1 > r->current_capacity)
        resize(r);