PVSStudio, - PowerPoint PPT Presentation

1 / 45
About This Presentation
Title:

PVSStudio,

Description:

?????????? A ???? int ?????????? ? ???? unsigned; ?????????? ???????? A ? B. ? ?????????? ?? ???????? ???????? 0xFFFFFFFF ???? unsigned; ... – PowerPoint PPT presentation

Number of Views:36
Avg rating:3.0/5.0
Slides: 46
Provided by: filesV7
Category:

less

Transcript and Presenter's Notes

Title: PVSStudio,


1
PVS-Studio, ??????????? ??????? ??? ??????????
??????????? ???????????? ??????????
  • ??? ????????
  • (??????? ??????????? ???????????)

www.viva64.com
2
??????????
  • ?????????? PVS-Studio
  • ?????????? Viva64 ??? ?????????? 64-??????
    ??????????
  • ?????????? VivaMP ??? ?????????? ????????????
    ??????????
  • ???????????? ? ??????? ???????? PVS-Studio
  • ?????????? ? ???????? ??? ????????

3
?????????? PVS-Studio
4
  • PVS-Studio ??????????? ?????????? ????, ???????
    ???????????? ??? ????????????? ???????????
    ???????????? ??????????
  • ? ?????? PVS-Studio ?????? ??? ??????????? ????
  • Viva64, ??????????????? ??? ?????????? ?
    ???????? 64-?????? ??????????
  • VivaMP, ??????????????? ??? ????????
    ???????????? ???????? ?? ?????? ?????????? OpenMP.

5
PVS-Studio ???????????? ????????? ???? ???????? ?
??/?? ????
  • ?????? ???????? 32-?????? ?????????? ?? 64-??????
    ???????
  • ??????, ??????????? ??? ?????????? ?????
    64-?????? ??????????
  • ????????????? ????????????? ?????? ? 64-??????
    ?????????? ?????????? ???????????? ????????????
  • ?????? ? ???????????? ??????????, ????????? ?
    ????????? ?????????? ?????????? OpenMP
  • ?????? ? ???????????? ??????????, ????????? ?
    ????????????? ??????? ????????? ?????????????????
    ???? ? ?????????????? OpenMP
  • ?????? ??-?? ???????????? ?????? ? ??????? ?
    ???????????? ???? (???????????? ?????? ? ?????
    ??????, ?????????? ?????????????, ????????????
    ????? ??????? ? ??????????, ? ?. ?.).

6
?????????? ???? PVS-Studio ????? ???, ???
  • ????????????? ????? 64-?????? ??????????
  • ????????? ???????? 32-??????? ???? ?? 64-??????
    ???????
  • ????????? ? ????????? ????????? ?????????????
    ?????????? ? ??????? ?????????? OpenMP.

7
?????? PVS-Studio?
  • ????? ???????
  • http//www.viva64.com/ru/pvs-studio/download/
  • ????? ???????????
  • PVS-Studio ????????????? ? Visual Studio
  • ? ???????????? ???? ??????? ???????? ? ????????.
  • ????? ?????? (?????? ??? ????? ????)
  • http//www.viva64.com/ru/order/

8
??????????? PVS-Studio
  • ????????? ?? ? ??
  • ?????????? ? Visual Studio 2005/2008
  • ???????????? ? MSDN ?????????? ???????
  • ???????? ?????????????

9
??????? ??? PVS-Studio
10
?????????? ??????? PVS-Studio ????????????? ? MSDN
11
????? ?????????? ?????? PVS-Studio ? ???????
???????? PortSample ? ParallelSample ??
????????????
12
????????? ???? ????????????
www.viva64.com/ru/customers/
13
Viva64, ?????????? ?????????? 64-?????? ??????????
14
???????? ???????? ?????????? ?? 64-??????
?????????
  • ??????? ???????? ???? ?????????.
  • ???????? C/C ?????????? ???????? ??????????
    ??-?? ???????????? ?????.
  • ??? ???????? ???????? ????????? ? ??????????
    ??????, ??????? ?? ??????? ???????????????
    ????????????? ?????????? ????????????.
  • ?????? ???????? ? ???????????? ???????????
    ???????? ????? ???????? ?? ?? 64-?????? ???????
    (? MS-DOS 1.0 ???? 4 000 ????? ????, ? ? Windows
    Vista ??? 50 000 000). ??????? ? ??????
    ?????????? ? ????? ??????? ?????????.

15
????????? 64-?????? ???????? ??? ??????? ????
???? ?? ????????? ? ???????????, ? ?????????
?? ?????? Kang Su Gatlin, Visual C Program
Manager, Microsoft Corporation, 2004
16
  • ???????? ??????? ??????, ?????????????? Viva64

17
???????? ? ??????????? ???????????? ?????????
  • ??????? ?????
  • class CWinApp
  • virtual void WinHelp(DWORD_PTR, UINT)
  • ??? ????????????
  • class CMyApp public CWinApp
  • virtual void WinHelp(DWORD, UINT)

32-?????? ???????
64-?????? ???????
18
???????? ?????????? ? ???????????
int A -2 unsigned B 1 int array5 1,
2, 3, 4, 5 int ptr array 3 ptr ptr
(A B) printf("i\n", ptr)
  • ?????????? A ???? int ?????????? ? ???? unsigned
  • ?????????? ???????? A ? B. ? ?????????? ??
    ???????? ???????? 0xFFFFFFFF ???? unsigned
  • ??????????? ????????? "ptr 0xFFFFFFFFu".
    ????????? ??????? ?? ??????????? ????????? ??
    ?????? ?????????. ? 32-?????? ?????????,
    ????????? ????? ???????????? "ptr - 1" ? ??
    ??????? ??????????? ????? 3. ? 64-??????
    ????????? ? ????????? ?????????? ????????
    0xFFFFFFFFu, ? ?????????? ???? ????????? ????????
    ?????? ?? ????????? ???????.

19
??????????? ?????
bool IsPresent(char array, size_t arraySize,
char key) for (unsigned i
0 i ! arraySize i) if (arrayi
key) return true return false
?????? ??? ???????? ? ????????????? ????????????
?????, ???? arraySize ???????? ???????? UINT_MAX.
????????? ???????? ?????? ? ??????????????
unit-?????? ??? ???????????? ????????????
(BoundsChecker) ?????? ????????? ??????????????
??????? ?? ??????? ?????? ??????. ??? ?????????
?????? ?????? ?????? ?????? ???????? ?? ?????
20
?????? ? ????????? ??????
ptrdiff_t SetBitN(ptrdiff_t value, unsigned
bitNum) ptrdiff_t mask 1 ltlt bitNum
return value mask
??? ????????? ????????? ???? ? ???????. ??????
?????? ??????????? ? ?????? ???????? ??????????.
??? ??????????? 31-?? ???? ?? 64-?????? ???????
??????????? ?????? ??????? ????? ????????
0xffffffff80000000
?????? ?????? ??????? ? ???, ??? ?????? ???
??????? ?? ???????? ????, ? ???????? 32-63.
???????? ????????, ??? "1" ????? ??? int ? ???
?????? ?? 32 ??????? ?????????? ????????????.
??????? ?? ? ?????????? 0 (A) ??? 1 (B) ???????
?? ?????????? ???????????.
21
?????? ????????????? ?????????? ?????
define N_COUNT 100 int pArray (int)
malloc(N_COUNT 4) hFileMapping
CreateFileMapping ( (HANDLE) 0xFFFFFFFF,
NULL, PAGE_READWRITE, (DWORD) 0,
(DWORD) (szBufIm), (LPCTSTR)
FileShareNameMap0) size_t n, newexp n n
gtgt (32 - newexp)
???????? ???????????????? ?????????? ????????,
??????? ??? ???????? ?????????? ? 32-?????? ??
64-?????? ?????????
22
???????????? ? ?????????????? ??????????, ???
????????? ???????????? 32-?????? ? 64-?????? ????
??????
ptrdiff_t UnsafeCalcIndex(int x, int y, int
width) return result x y
width ... int domainWidth 50000 int
domainHeght 50000   for (int x 0 x !
domainWidth x) for (int y 0 y !
domainHeght y) arrayUnsafeCalcIndex(x, y,
domainWidth) 1
?????? ??? ?? ????? ????????? ????????? ??????,
????????? ?? 5000050000 ?????????. ???
?????????? ????????? "x y width" ??????????
???????????? ? ??????????? ????? ????? ?? ???????
???????.
23
?????? ???????? ?????????? ????
size_t __fread(void __restrict buf, size_t
size, size_t count, FILE
__restrict fp)   size_t fread(void __restrict
buf, size_t size, size_t count,
FILE __restrict fp) int ret FLOCKFILE(fp)
ret __fread(buf, size, count,
fp) FUNLOCKFILE(fp) return (ret)
??????? __fread ?????????? ??? size_t, ?? ???
???????? ?????????? ??????????? ???? ????????????
??? int. ? ?????????? ??? ??????? ???????
???????? ?????? ??????? ????? ??????? ?? ??
?????????? ????, ??????? ?? ????? ???? ?????
?????????.
24
?????????? ????? ?????? ???? ?? ????????? ????
FreeBSD.?????? ???? ?????????? ?????? ? ???????
2008 ????!??? ??? ???, ??? ??????
(?????????????????) 64-?????? ?????? FreeBSD
????? ??? ? ???? 2003 ????.
25
??? ?? ?????? ?????????? 64-??????? ????
  • ???? ??????????? ???????? 64-?????? ?????? ? ????
    ?? ????? ??? 100 ????????? ??????? ? ???????? ?
    ??????????? ????????.
  • ????? ??????????? ???? ???????? ???? ???????
    ?????????? ????????????? ? ???????????? ?? C.
  • ? ???? ???????????? ??????? ???? ?? ??????????
    ???????? ????????? ????????? ??????, ????????? ?
    ????????? ???? ?? 64-?????? ???????. ? ????
    ?????? ??? ????????? (??????????????) ??????, ???
    ? ??????????? ?????.
  • ?? ?????? ?????????? ????????? ??????
    ?????????????? ??????? ?? ???????????.
  • ? ???????? ??????, ? ??????? ???????????
    ???????????? ? ????? ??????? ? ???????? ???
    ???????????? ???? ????????.

26
????????? Viva64,VC (/Wp64), CTest ? PC-Lint
27
?????????? Viva64 ??? ???????? CAD-??????? Leios
Studio ???????? EGS S.r.l.
  • ???????? E.G.S. S.r.l. ??????????
  • ??????????? ??????? ? ???????
  • ????????????? ?????????? ????????
  • ?? ???? ????????????????? ?????.

28
?????????? Viva64 ??? ???????? CAD-??????? Leios
Studio ???????? EGS S.r.l. (???????????)
  • ????? ????? ????????? ???? Leios Studio
    ?????????? 13 ???????? (440 000 ????? ????).
  • ???????? ???? ? ?????????????? Viva64 ?????????
    ?????????? ????? ???????, ??????? ?? ????????
    ????????? ?? ?????? ???????? ????.
  • ???????? ?????????? ???????, ?????????? ?
    ???????? ??????????????? ??????? ???? ? ???????
    ??????????? Viva64
  • ??????????? ?????????????? ?????????? ???
    ????????? ??????? ??????? ??????
  • ?????? ? ??????? ???????? ???????
  • ????????? 3d-???????, ?????????? ???????
    ?????????? ????????????? (??? ??????
    ?????????????, ??? ?????? ??????)
  • ?????? ?????????? ??????????????

??????????? http//www.viva64.com/art-1-1-3164907
581.html
29
?????????? ?? ?????????? ??????? ? ?????????? Loki
http//loki-lib.sourceforge.net
  • ?????? ???????
  • 1.5Mb, 125 ??????
  • ????????
  • ????????????-?????????????????? ? ???????
    Viva64 89
  • ?? ??? ???????? ?????? 6

??????????? http//www.viva64.com/art-1-1-2844886
463.html
30
VivaMP, ?????????? ?????????? ????????????
(OpenMP) ??????????
31
???????? ? ???? ????????, ???????????? OpenMP
  • ?????????? ???????? ???? ? ??????????
  • ???????????? ?????? ? ????????????
  • ??????????? ????????? ???? ?? ??????????
    ??????????? ??? ???????
  • ????????????? ?????? ? ????? ????????
  • ???????????? ?????? ? ????? ??????
  • ???????????? ????????????? ????????? ??????????
  • ???????? ?????? ?????? ?? ????????????? ??????
  • ?????? ??????????????????

32
  • ???????? ??????? ??????, ?????????????? VivaMP

33
?????????????? ?????????? ? ???????????? ???????
pragma omp parallel for for (size_t i 0 i !
n i) float array new float10000
delete array
?????? ???????? ? ????????????? ?????????
????????? ?, ?????? ?????, ? ?? ??????????
??????????, ???? ?????????? ?????? ?????????
??????. ?????? ???????? ? ?????????????
?????????? ?? ???????????? ??????. ????????
???????????? OpenMP, ???? ?? ???????????
?????????? ?????? ???????????? ??????, ?? ??? ???
?????????? ?????? ???? ?????????? ?????? ????
??????. ???? ?? ??????????? ?????? ????????????
?????? ???????? new, ?? ?? ?????? ???????????? ?
????????? ??????????, ??????? ???????? ?????????
????? ?? ????? ????????????? ??? ??????
????????? ??????.
34
?????? ??????????????? ????????????? ???????? ?
??????? OpenMP
35
?????? ????????? ????? (race condition)
int a 0 pragma omp parallel for
num_threads(4) for (int i 0 i lt 100000 i)
a
????????? ????? ????????? ?????, ????? ?????????
??????? ?????????????? ?????????? ????????
???????????? ???????? ?????? ? ??????, ??????
???? ?? ???? ????? ????????? ??????. ?????????
????? ????? ?????? ??????????????? ??????????, ?
???????? ?? ?????? ???????. ?????? ???????????
????????? ????? ??????????? ?????? ????? ???????
?????????? ??????? ? ? ?????? ?????? ?????
??????????. ????? ????, ?????? ?????? ????
?????????? ?????? ????????????? ????????.
?????? ??????????? ???????? ????????? ??
??????? ???? ????? ????? ?????? ? ???????
???????????? ??????? ??? ?? ????? ????????? ????.
36
?????? ????????????? ??????????? ???????? ?
???????????? ???????
pragma omp parallel static int st
Calc() ...
??????????? ?????????? ?????? ???????
????????????? ????? ? ?????????? ???????, ???
????? ???????? ? ??????????????? ??????????.
???????????? ???????? ?????? ??????????? ? ??
???????????? ? ?????? ?????????? ?? ?????
????????????.
37
???????????? ? ??????? ???????? PVS-Studio
38
???????? ??? ???? ??????????????
  • ???????? ?? ?????? ???????????? (Single User
    License)
  • ????????? ???????? ?? 5 ????????????? (Team
    License)

39
???????? ?? ?????? ????????????(Single User
License)
40
????????? ???????? ?? 5 ????????????? (Team
License)
41
?????????? ? ????????
42
???????????????? ?????????????
  • ????????????? ?? ??????????? ??????????? ????????
    ??? ??? N2007614164, ????64. ???????????????? ?
    ??????? ???????? ??? ??? 28 ???????? 2007 ?.
  • ????????????? ?? ??????????? ??????????? ????????
    ??? ??? N2008610480, ?????????? ??????? ????
    VivaCore. ???????????????? ? ??????? ????????
    ??? ??? 25 ?????? 2008 ?.
  • ????????????? ?? ??????????? ??????????? ????????
    ??? ??? N2008612845, ????64 2.0.
    ???????????????? ? ??????? ???????? ??? ??? 29
    ??? 2008 ?.

43
???? ?????? ???????????? ?? ??????????
??????????????? ??????
http//www.viva64.com/ru/about/experience/
44
???? ?????? ??????
  • ??????? ??????? ?? PVS-Studio
  • http//www.viva64.com/art-4-1-1796251700.html
  • 20 ??????? ???????? ?? - ???? ?? 64-??????
    ?????????
  • http//www.viva64.com/art-1-1-1958348565.html
  • 32 ????????? ????? OpenMP ??? ???????????????? ??
    ??
  • http//www.viva64.com/art-3-1-464379766.html
  • ?????? ?????? ?? ?????????? 64-?????? ?
    ???????????? ????????, ? ????? ?? ??????????
    ??????? ???? ??????? ??
    http//www.viva64.com/ru/articles/

45
?????????? ? ????????
  • ??? ????????
  • 300027, ??????, ????, ??????????? 70-1-88.
  • Web www.viva64.com
  • E-mail support_at_viva64.com
  • ??????? 7 (4872) 38-59-95
  • ??????? ????? 0900 1800 (GMT 300)
Write a Comment
User Comments (0)
About PowerShow.com