[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] [ RFC] About packing two infos in a long v2

From: grischka
Subject: Re: [Tinycc-devel] [ RFC] About packing two infos in a long v2
Date: Thu, 15 Nov 2012 16:12:17 +0100
User-agent: Thunderbird (Windows/20090812)

address@hidden wrote:

    struct {
        unsigned long got_offset;
        unsigned some_attribute:X;

rather unsigned char some_attribute:X; in that case. No need to waste more than 
a byte.

        <more ...>
    } *symbol_attributes:
   int nb_symbol_attributes;

It's fine for me. I was just concerned about tcc's memory usage. Shall I 
proceed with the change you describe?

Well, why not.  It doesn't cover yet consequent pass-trough of the
AttributeDef but it could be a step in the right direction.

I'd suggest changing
    static void put_got_offset(TCCState *s1, int index, unsigned long val);
into a more general
    static struct sym_attribute *get_sym_attribute(TCCState *s1, int index);
which would expand the array with an empty entry if needed.

Thus the currently single instance of usage
    put_got_offset(s1, sym_index, s1->got->data_offset);
would become
    get_sym_attribute(s1, sym_index)->got_offset = s1->got->data_offset;

Anyway, just my 2 cents of completely untested suggestions. ;)

--- grischka

reply via email to

[Prev in Thread] Current Thread [Next in Thread]