[tor-bugs] #7305 [Tor]: enum variables with defined bit width

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Sun Nov 4 04:33:52 UTC 2012


#7305: enum variables with defined bit width
-----------------------------+----------------------------------------------
 Reporter:  ultramage        |          Owner:                    
     Type:  defect           |         Status:  new               
 Priority:  normal           |      Milestone:  Tor: 0.2.4.x-final
Component:  Tor              |        Version:                    
 Keywords:  msvc tor-client  |         Parent:                    
   Points:                   |   Actualpoints:                    
-----------------------------+----------------------------------------------
Changes (by nickm):

  * keywords:  msvc => msvc tor-client
  * milestone:  => Tor: 0.2.4.x-final


Comment:

 > Ideally stop using bit packing entirely in memory-only structures, and
 serialize to integer types of exact size when crafting packets

 I think that the "store these as unsigned rather than as enum" approach is
 far more reasonable.  (We never serialize a struct, I hope, and the reason
 we bit-pack these things is to save RAM.  In some cases, as for circuits
 or policies, we allocate a really huge number of these things.)


 This could go either 0.2.3 or 0.2.4, but I'm leaning 0.2.4 since it's a
 nontrivial fix and MSVC is a semi-supported build environment for 0.2.3.

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/7305#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list