Hi!<br><br>The ac++ is reporting following error:<br><br>include//click/bighashmap_arena.hh:71: error: `unuse' is not a member of `HashMap_Arena'<br><br>But as one can clearly see from the header file it is:<br><br>
1 // -*- c-basic-offset: 4; related-file-name: "../../lib/bighashmap_arena.cc" -*-<br> 2 #ifndef CLICK_BIGHASHMAP_ARENA_HH<br> 3 #define CLICK_BIGHASHMAP_ARENA_HH<br> 4 CLICK_DECLS<br> 5 <br> 6 class HashMap_Arena { public:<br>
7 <br> 8 HashMap_Arena(uint32_t element_size);<br> 9 <br> 10 void use() { _refcount++; }<br> 11 void unuse();<br> 12 <br> 13 bool detached() const { return _detached; }<br> 14 void detach() { _detached = true; }<br>
15 <br> 16 void *alloc();<br> 17 void free(void *);<br> 18 <br> 19 private:<br> 20 <br> 21 struct Link {<br> 22 Link *next;<br> 23 };<br> 24 Link *_free;<br> 25 <br> 26 enum { NELEMENTS = 127 }; // not a power of 2 so we don't fall into a<br>
27 // too-large bucket<br> 28 char *_cur_buffer;<br> 29 int _buffer_pos;<br> 30 <br> 31 uint32_t _element_size;<br> 32 <br> 33 char **_buffers;<br> 34 int _nbuffers;<br> 35 int _buffers_cap;<br>
36 <br> 37 uint32_t _refcount;<br> 38 bool _detached;<br> 39 <br> 40 HashMap_Arena(const HashMap_Arena &);<br> 41 ~HashMap_Arena();<br> 42 HashMap_Arena &operator=(const HashMap_Arena &);<br>
43 <br> 44 void *hard_alloc();<br> 45 <br> 46 friend class Link; // shut up, compiler<br> 47 <br> 48 };<br> 49 <br> 50 class HashMap_ArenaFactory { public:<br> 51 <br> 52 HashMap_ArenaFactory();<br> 53 virtual ~HashMap_ArenaFactory();<br>
54 <br> 55 static void static_initialize();<br> 56 static void static_cleanup();<br> 57 <br> 58 static HashMap_Arena *get_arena(uint32_t, HashMap_ArenaFactory * =0);<br> 57 <br> 58 static HashMap_Arena *get_arena(uint32_t, HashMap_ArenaFactory * =0);<br>
59 virtual HashMap_Arena *get_arena_func(uint32_t);<br> 60 <br> 61 private:<br> 62 <br> 63 HashMap_Arena **_arenas[2];<br> 64 int _narenas[2];<br> 65 <br> 66 static HashMap_ArenaFactory *the_factory;<br>
67 <br> 68 };<br> 69 <br> 70 /*inline*/ void<br> 71 HashMap_Arena::unuse()<br> 72 {<br> 73 _refcount--;<br> 74 if (_refcount <= 0)<br> 75 delete this;<br> 76 }<br> 77 <br> 78 inline void *<br> 79 HashMap_Arena::alloc()<br>
80 {<br> 81 if (_free) {<br> 82 void *ret = _free;<br> 83 _free = _free->next;<br> 84 return ret;<br> 85 } else if (_buffer_pos > 0) {<br> 86 _buffer_pos -= _element_size;<br> 87 return _cur_buffer + _buffer_pos;<br>
88 } else<br> 89 return hard_alloc();<br> 90 }<br> 91 <br> 92 inline void<br> 93 HashMap_Arena::free(void *v)<br> 94 {<br> 95 Link *link = reinterpret_cast<Link *>(v);<br> 96 link->next = _free;<br>
97 _free = link;<br>
98 }<br> 99 <br>100 CLICK_ENDDECLS<br>101 #endif<br><br>The 'inline' keyword was uncommented by me just to make sure that wasn't the breaking point.<br><br>Anyone got any ideas why this might be breaking?<br>
<br>Thank you,<br>Guilherme<br>