Resume Template Download For Freshers – resume template download for freshers
Our aggregation has afresh able porting one appealing ample action (9 actor cipher lines, 300 Mbytes of antecedent files) to the 64-bit platform. It took us one year and a half. Although we are not acceptable by the NDA to acknowledge the action name, we still achievement that our acquaintance will advice added developers in their work.
We are accepted to abounding bodies as the authors of the PVS-Studio changeless cipher analyzer. Indeed, this is our aloft acreage of activity. But we additionally booty allotment in assorted third-party projects as an able team. We alarm it “expertise selling”. Some time ago we appear a address on ability of our assignment on Unreal Engine 4. Today we present addition address on the assignment we accept done for our latest ability affairs task.
“Aha, they charge be accepting adamantine times with PVS-Studio then!”, some readers afterward our action may think. But we accept to abort those acquisitive for sensations. Accommodating in third-party projects is absolutely a actual important action for our team, but for a altered reason. It is the way for us to added actively use our own apparatus in absolute life, not alone aback alive on its development. The accustomed use of the analyzer in real-life bartering projects developed by dozens or alike hundreds of developers is a antecedent of abundant acquaintance for the PVS-Studio team. We can see how bodies use our tool, what difficulties they face, and what we should change or advance in our product.
That’s why we are action to accumulate accommodating in such projects aural the ambit of our ability affairs activity. So feel chargeless to acquaintance us if you accept a action we could advice you with. And for now we are animated to present this address about cipher clearing to the 64-bit platform.
At aboriginal glance, the assignment of porting affairs cipher to the x64 belvedere looks bright and trivial. Aback in 2010, we wrote our time-tested commodity “A Collection of Examples of 64-bit Errors in Absolute Programs”. In 2012, we appear our training advance “Lessons on development of 64-bit C/C applications”. All you accept to do is chase the recommendations and guidelines accustomed there and aggregate will be fine, right? Afresh why did the chump charge to ask a third-party aggregation (i.e. us) and why alike we had to absorb one year and a bisected to achieve it? Back we apparatus assay of 64-bit issues as allotment of PVS-Studio’s functionality, we care to apperceive our way about the subject, oughtn’t we? Yes, and we absolutely apperceive our accountable actual well, and it was the aloft acumen why the chump contacted us. But why did they accept to ask anyone for advice with 64-bit clearing of their cipher at all?
Let’s aboriginal say a few words about the action and the customer. Back we are not accustomed by the NDA to acknowledge the advice directly, I will alone accord you some figures. The action we were alive on is about 20 years old. Presently there are a few dozens of programmers alive on it every day. Their barter are ample companies, and their sales are attenuate as their artefact is awful specialized.
And the aloft appropriate is the cipher size. The antecedent cipher includes 9 actor cipher curve and has the all-embracing admeasurement extensive 300 Mbytes, the band-aid (.sln) book all-embracing bags of projects, which is a HUGE number. The ambition belvedere is Windows only. But alike with that affectionate of a project, there shouldn’t be any intricacies about the 64-bit clearing task, should it? To anchorage a action like that to the x64 platform, you alone charge to do the following:
Why do we accept “stop the development action absolutely for a few months” as the aboriginal step? Because you absolutely charge to alter some abstracts types with 64-bit ones for acknowledged 64-bit migration, of course. Creating a abstracted annex in a action of a admeasurement like that and accomplishing all the all-important edits there aloof won’t advice because you will abort aggravating to absorb it with the aloft cipher later! Accumulate in apperception the action admeasurement and dozens of programmers abacus new cipher every day.
Due to some business apprenticed limitations, the chump couldn’t stop the development process. Their own barter would consistently charge new releases, bug fixes, appropriate features, etc. To stop the development action in affairs like those would beggarly to stop the business entirely. That’s why they set about gluttonous a aggregation who could advice to anchorage the action after endlessly the development process. They chose us because our adequacy in 64-bit development had been accepted by our cipher analyzer PVS-Studio and accessories on this subject.
We able this assignment in one year and a half. During the aboriginal bisected a year, there were two developers accommodating in the action on our part, and the abutting year there were four of us. Why did it booty us so long? During the aboriginal bisected a year, those two developers were ambience up the infrastructure, belief the project, and aggravating altered clearing algorithms. Then, as the assignment had become added well-defined, we added two added guys to the aggregation and the action clearing was assuredly able by 4 programmers one year later.
On a ample scale, the 64-bit clearing assignment is comprised of the afterward two steps:
As you remember, memsize-types are those which accept a capricious size, in accurate 4 bytes on the 32-bit arrangement and 8 bytes on the 64-bit one.
Porting a all-embracing and assiduously developing action shouldn’t baffle with the accepted development process, so we fabricated the afterward arrangements. First, we were accomplishing all our edits in a abstracted annex so that we didn’t breach the aloft build. Already every new set of our changes was accessible and tested, we would absorb them with the trunk. Second, we absitively to go after anon replacing 32-bit types with memsize-types. Instead, we created our own types to alter the aboriginal ones. It was done in adjustment to abstain any abeyant troubles such as calling altered implementations of an active function, and additionally to leave an befalling for us to rapidly cycle aback any changes if necessary. Our types were implemented in a arrangement like this:
I’d like to point out already afresh that we replaced the aboriginal types with our own ones, not with size_t/ptrdiff_t and the like. It gave us a lot of adaptability and accustomed us to calmly acquaint the already ported bits from those yet “untouched by animal hands”.
The aboriginal abstraction was the following: aboriginal we would alter all the 32-bit types with memsize-types except those bits area 32-bit types had to be larboard clear (for archetype structures implemented as abstracts formats, and functions processing such structures) and afresh set it up to work. We chose this band-aid to annihilate as abounding 64-bit issues as accessible at already and do it in one run, and afresh fix all the actual warnings of the compiler and PVS-Studio. Although this access works able-bodied for baby projects, it didn’t clothing us this time. First, blazon backup took too continued and complex too abounding changes. Second, admitting aggravating to be actual careful, we still replaced a few structures with abstracts formats by mistake. As a result, aback we able alive on the aboriginal allocation of the projects and ran the application, we bootless to amount the pre-installed interface templates as they were binary.
So, the aboriginal plan adumbrated the afterward algorithm.
This plan was accustomed as unsuccessful. We able the aboriginal bristles accomplish but had to cycle aback all the changes in the antecedent code. That is, we had ashen several months.
Now we absitively to try accepting a alive 64-bit adaptation of the appliance as anon as possible, and alone afresh fix the best axiomatic 64-bit issues. Our new plan didn’t accommodate for accumulation blazon backup and alone adumbrated acclimation the best acute 64-bit errors:
This time we got the aboriginal alive adaptation way sooner, additionally because we already had the third-party libraries congenital by the time and the interface templates loaded correctly. It should be acclaimed that the appliance would run appealing durably best times, which afraid us actual much. We had aloof a few crashes at the aboriginal testing.
After that, we had to fix the compiler warnings and 64-bit warnings by the PVS-Studio analyzer to annihilate all the detected and abeyant crashes. Back the absolute cardinal of 64-bit warnings by PVS-Studio accomplished thousands, we absitively to alone fix the best important ones: absolute conversions of memsize-types to 32-bit types (V103, V107, V110), conversions of pointers to 32-bit types and carnality versa (V204, V205), apprehensive about-face sequences (V220, V221), analogous the types of basic action ambit (V301), and replacing alternate functions with new versions (V303). See thedocumentation for descriptions of these diagnostics.
In added words, the assignment at this date was to fix all the 64-bit warnings of PVS-Studio beneath Level 1 only. These are the best acute diagnostics, and all the agnate issues charge be anchored for a 64-bit appliance to barrage successfully.
Most of these edits in actuality adumbrated replacing 32-bit types with memsize-types, like in the aboriginal approach. But, clashing it, we did those replacements selectively and iteratively this time. It was bent by the actuality that alteration action constant types led in its about-face to alteration the types of bounded variables and alternate values, which, in their own turn, led added to alteration the types of added functions’ parameters, and so on, until the circled was closed.
Another con of this access as compared to the aboriginal one is that we could alone fix the best analytical 64-bit issues. For instance, adverse types were larboard untouched: in best cases, we didn’t charge them, and they wouldn’t account any errors anyway. But in some fragments, I guess, we still should accept got them fixed, and we had skipped them and wouldn’t be able to acquisition afresh if afraid to the called approach. In added words, we may accept to do some added fixes some time later.
When porting the application, we additionally bare the 64-bit versions of the third-party libraries acclimated in the project. For open-source libraries, we approved to body them from the aforementioned antecedent files the 32-bit ones had been congenital from. The acumen was that we capital to accumulate all the accessible bug fixes already done in their code, if any; and we additionally bare to body them, whenever possible, in the aforementioned agreement as for the 32-bit versions — for archetype with the accumulation about-face cogent the compiler not to amusement wchar_t as a congenital blazon or with a disabled Unicode support. In such cases, we had to comedy about with architecture ambit a bit afore we could amount out why they wouldn’t articulation with our project. Some libraries aloof weren’t advised for re-building in the 64-bit version, in which cases we had to either catechumen them ourselves or download fresher versions acceptance the 64-bit build. In case of bartering libraries, we would either ask the chump to acquirement the 64-bit adaptation or attending for a acting for those of them which had no abutment any more, like it was with xaudio.
We additionally had to get rid of all the assembler insertions as the 64-bit adaptation of the Visual C compiler doesn’t abutment Assembler. In this case, we would either use built-in functions wherever accessible or carbon the cipher in C . In some cases, it didn’t alike account any achievement losses — for instance aback the 32-bit assembler cipher bits acclimated 64-bit MMX registers, all the registers in our 64-bit adaptation were already 64-bit.
When alone starting to assignment on a all-embracing project, you can’t say for abiding how continued its clearing will take. We had to absorb absolutely a lot of time at the aboriginal date on architecture the third-party libraries, ambience up the ambiance for circadian builds of the 64-bit version, and testing. Already able with the aboriginal allocation of the projects, we could appraisal our alive acceleration based on the admeasurement of cipher already ported during a assertive time period.
The best accepted absurdity aback porting the action to the 64-bit belvedere appeared to be an absolute about-face of pointers to 32-bit types, for archetype DWORD. In such cases, we replaced those types with memsize-types. For example:
We were additionally faced by errors aback alteration basic action ambit in a abject class. For example, the constant blazon in CWnd::OnTimer(UINT_PTR nIDEvent) had afflicted from UINT to UINT_PTR aback the 64-bit Windows adaptation had been released, so we had to do this backup in all the brood classes in our action too. For example:
Some WinAPI functions can assignment with ample abstracts amounts, for archetype CreateFileMapping and MapViewOfFile. So we acclimatized the cipher accordingly:
We additionally begin a cardinal of functions which are advised alternate in the 64-bit adaptation and charge be replaced with the agnate new implementations. For example, the GetWindowLong/SetWindowLong functions charge be replaced with GetWindowLongPtr/SetWindowLongPtr.
All the examples cited aloft as able-bodied as abounding added types of 64-bit issues can be begin by the PVS-Studio analyzer.
Potential errors associated with 64-bit clearing can be partially detected by the compiler. However, PVS-Studio is abundant bigger at this assignment back it has been originally advised to ascertain bugs of that kind. To acquisition out added about what 64-bit errors PVS-Studio can ascertain which the compiler and Visual Studio’s changeless analyzer cannot, see the commodity “64-Bit Cipher in 2015: New in the Affection of Accessible Issues”
I’d like to acknowledgment one added important thing. Using the changeless analyzer regularly, we could see in real-time how old bugs were alone and some new 64-bit ones were added into the code. You see, the cipher is consistently actuality edited by dozens of programmers, and sometimes they accomplish mistakes consistent in 64-bit errors in the action already acclimatized for x64 mode. But for changeless analysis, we wouldn’t be able to acquaint for abiding how abounding bugs had been anchored and how abounding had been added and how far we had progressed. Thanks to PVS-Studio, we could draw diagrams to advice us admeasurement our progress. But this is addition story.
To ensure as bland 64-bit clearing of your action as possible, you should stick to the afterward algorithm:
Article republished by the author’s permission.