스택영역 우리는 이제껏 스택영역에 메모리를 할당해 왔습니다. 컴파일 시점에 결정되는 영역입니다.
힙 영역 이 영역의 메모리는 실행시점(Run Time)에 결정됩니다. 프로그래머에 의해서요. 이 영역을 힙영역이라고 합니다.
데이터 영역 이 영역의 메모리는 정적변수, 전역변수, 구조체 등 함수 외부에서 선언되는 변수들이 이 메모리에 할당됩니다.
코드 영역 코드영역에는 프로그램의 실행 명령어들이 존재합니다.
우리가 이번에 주목해야할 영역은 힙영역입니다. 위의 코드를 정상적이게 동작시키기 위해서는요. 그 목적을 달성하기 위해서 나온 함수가 바로 malloc함수입니다. malloc함수는 stdlib헤더에 선언되어 있으며 malloc함수를 사용하기 위해서는 stdlib.h를 include해야합니다.
void *malloc(size_t size)
이 함수는 size만큼의 메모리를 힙영역에 할당합니다. 어떤 자료형일지 모르니 반환형 데이터는 void포인터입니다. 하지만 그냥 메모리만 할당하고 해제하지 않으면 메모리가 누출됩니다. 우리는 메모리를 이제 쓰지 않을 경우(거의 함수 반환 직전)에 free함수를 써서 메모리를 해제해야합니다.
1. 프로세스 리스트 확인 : tasklist 1) 설명 : 프로세스 리스트를 보여준다 2) 입력 구조 : TASKLIST [/S 시스템 [/U 사용자 이름 [/P [암호]]]] [/M [모듈] | /SVC | /V] [/FI 필터] [/FO 형식] [/NH] 3) 기본 구성 : 프로세스 명, pid, 세션명 등을 보여준다
2. 프로세스 kill : taskkill 설명 : 개발을 진행하거나 하다보면 여기저기 튀어나오는 좀비들때문에 여간 귀찮은것이 아니다. 그럴때 프로세스를 죽일수 있는 명령어가 taskkill 이다 2) 기본 구성 : TASKKILL[/S시스템[/U사용자이름[/P[암호]]]] { [/FI 필터] [/PID 프로세스 id | /IM 이미지 이름] } [/T] [/F] 3) 주요 옵션 a. /PID 프로세스 ID : 특정 프로세스ID의 프로세스 종료하기 예시 : taskkill /PID 21500 -> 21500 PID를 가지는 프로세스 종료해라 b. /IM 프로세스명 : 특정 이름을 가지는 프로세스 종료(와일드카드(*) 사용가능) 예시 : taskkill /IM java* -> java로 시작하는 이름을 가진 프로세스 종료해라 c. /T : 지정된 프로세스와 그 자식 프로세스 까지 종료 예시 : taskkill /T /PID 21303 -> PID가 21303인 프로세스와 그 자식 프로세스 까지 종료
3. WMIC 명령어를 통한 부모 프로세스 찾기
wmic를 통해 보고싶은것만 찾아보자 -> wmic process where 항목="항목값" get 파라미터1, 파라미터2, 파라미터3 -> 프로세스 항목의 값이 "항목값인" 프로세스의 파라미터1, 파라미터2, 파라미터3 정보를 표시해준다. 예시) wmic process where name="chrome.exe" get processid, parentprocessid, commandline -> 프로세스명이 chrome.exe인 프로세스의 pid, ppid, commandline을 볼수 있다.
C:\Users>tasklist
이미지 이름 PID 세션 이름 세션# 메모리 사용 ========================= ======== ================ =========== ============ System Idle Process 0 Services 0 8 K System 4 Services 0 1,164 K Secure System 56 Services 0 22,768 K Registry 112 Services 0 23,268 K smss.exe 396 Services 0 956 K csrss.exe 568 Services 0 3,892 K wininit.exe 668 Services 0 4,140 K services.exe 892 Services 0 7,948 K LsaIso.exe 900 Services 0 3,484 K lsass.exe 920 Services 0 12,788 K svchost.exe 356 Services 0 18,748 K fontdrvhost.exe 520 Services 0 2,028 K svchost.exe 980 Services 0 12,752 K svchost.exe 1068 Services 0 6,900 K svchost.exe 1228 Services 0 7,408 K svchost.exe 1240 Services 0 6,648 K svchost.exe 1288 Services 0 3,824 K svchost.exe 1404 Services 0 5,512 K svchost.exe 1412 Services 0 6,232 K svchost.exe 1476 Services 0 14,064 K svchost.exe 1508 Services 0 10,360 K svchost.exe 1568 Services 0 4,260 K svchost.exe 1596 Services 0 6,448 K svchost.exe 1604 Services 0 5,120 K svchost.exe 1652 Services 0 5,432 K svchost.exe 1704 Services 0 4,872 K svchost.exe 1736 Services 0 6,824 K svchost.exe 1916 Services 0 7,768 K WUDFHost.exe 1940 Services 0 4,496 K svchost.exe 2000 Services 0 6,024 K svchost.exe 2008 Services 0 4,196 K svchost.exe 2016 Services 0 6,968 K svchost.exe 2112 Services 0 7,512 K svchost.exe 2140 Services 0 4,760 K Memory Compression 2148 Services 0 209,304 K igfxCUIService.exe 2188 Services 0 4,996 K svchost.exe 2196 Services 0 4,376 K svchost.exe 2256 Services 0 4,352 K svchost.exe 2272 Services 0 4,140 K svchost.exe 2344 Services 0 4,816 K svchost.exe 2464 Services 0 4,568 K svchost.exe 2536 Services 0 5,204 K svchost.exe 2564 Services 0 5,280 K svchost.exe 2576 Services 0 5,456 K svchost.exe 2708 Services 0 6,068 K svchost.exe 2780 Services 0 4,116 K svchost.exe 2864 Services 0 11,904 K svchost.exe 2912 Services 0 5,008 K svchost.exe 3016 Services 0 4,668 K svchost.exe 3024 Services 0 5,256 K svchost.exe 2948 Services 0 4,376 K svchost.exe 3176 Services 0 4,328 K svchost.exe 3212 Services 0 8,216 K svchost.exe 3252 Services 0 6,152 K spoolsv.exe 3340 Services 0 5,708 K svchost.exe 3380 Services 0 3,972 K svchost.exe 3476 Services 0 14,992 K svchost.exe 3484 Services 0 5,884 K svchost.exe 3492 Services 0 20,832 K eausvc.exe 3500 Services 0 1,720 K ObCrossEXService.exe 3508 Services 0 2,380 K AnySign4PCLauncher.exe 3520 Services 0 9,612 K IniClientSvc_x64.exe 3532 Services 0 5,548 K kpmsvc.exe 3544 Services 0 1,736 K macourtsafersvc.exe 3576 Services 0 2,468 K svchost.exe 3600 Services 0 23,728 K svchost.exe 3676 Services 0 6,176 K nossvc.exe 3684 Services 0 1,384 K runSW.exe 3704 Services 0 2,860 K ASDSvc.exe 3720 Services 0 11,492 K svchost.exe 3728 Services 0 4,060 K svchost.exe 3740 Services 0 4,516 K TENXW_SVR.exe 3804 Services 0 4,160 K MsMpEng.exe 3868 Services 0 218,900 K svchost.exe 3892 Services 0 3,912 K svchost.exe 3916 Services 0 8,240 K wpmsvc.exe 3936 Services 0 6,412 K svchost.exe 3996 Services 0 5,548 K svchost.exe 4104 Services 0 3,916 K svchost.exe 4352 Services 0 4,048 K svchost.exe 4480 Services 0 6,004 K wlanext.exe 4612 Services 0 4,608 K conhost.exe 4632 Services 0 3,328 K NisSrv.exe 5512 Services 0 6,948 K svchost.exe 5876 Services 0 13,572 K PresentationFontCache.exe 6736 Services 0 4,220 K svchost.exe 6852 Services 0 12,852 K svchost.exe 7044 Services 0 4,600 K svchost.exe 7088 Services 0 6,744 K svchost.exe 7428 Services 0 4,784 K svchost.exe 7632 Services 0 8,096 K svchost.exe 7960 Services 0 5,472 K svchost.exe 9388 Services 0 10,012 K svchost.exe 9544 Services 0 28,188 K SearchIndexer.exe 9860 Services 0 20,920 K svchost.exe 1332 Services 0 8,232 K svchost.exe 3412 Services 0 8,052 K GoogleCrashHandler.exe 11268 Services 0 752 K GoogleCrashHandler64.exe 11276 Services 0 632 K svchost.exe 12040 Services 0 8,956 K svchost.exe 12212 Services 0 6,048 K SecurityHealthService.exe 12096 Services 0 12,520 K svchost.exe 9812 Services 0 5,148 K SgrmBroker.exe 8676 Services 0 7,504 K svchost.exe 11304 Services 0 8,516 K svchost.exe 7844 Services 0 4,596 K csrss.exe 3140 Console 2 4,260 K winlogon.exe 14184 Console 2 5,940 K fontdrvhost.exe 12684 Console 2 4,444 K dwm.exe 13324 Console 2 42,940 K MoUsoCoreWorker.exe 3908 Services 0 18,648 K TEWebP.exe 9676 Console 2 4,740 K TEWebP64.exe 9712 Console 2 6,660 K svchost.exe 9120 Services 0 7,272 K svchost.exe 4620 Services 0 4,216 K SwUSB.exe 12296 Console 2 5,272 K AnySign4PC.exe 12552 Console 2 8,784 K kpmcnt.exe 8272 Console 2 2,756 K sihost.exe 6000 Console 2 18,520 K svchost.exe 4492 Console 2 16,296 K svchost.exe 9336 Console 2 17,144 K taskhostw.exe 13520 Console 2 9,328 K igfxEM.exe 4316 Console 2 8,168 K igfxHK.exe 7564 Console 2 6,936 K igfxTray.exe 2632 Console 2 7,988 K INISAFEAdminUtil.exe 10336 Console 2 2,488 K ctfmon.exe 10724 Console 2 9,280 K explorer.exe 10788 Console 2 70,700 K nosstarter.npe 6708 Console 2 11,500 K svchost.exe 8216 Console 2 8,980 K macourtsafer.exe 12112 Console 2 2,540 K CrossEXService.exe 10852 Console 2 2,708 K msedge.exe 5048 Console 2 99,368 K msedge.exe 13576 Console 2 5,352 K TEWeb.exe 13432 Console 2 3,868 K msedge.exe 10044 Console 2 118,148 K msedge.exe 13420 Console 2 25,536 K msedge.exe 11516 Console 2 6,620 K TEWeb64.exe 11128 Console 2 6,820 K delfino.exe 11952 Console 2 6,644 K INISAFECrossWebEXSvc.exe 10216 Console 2 7,412 K veraport-x64.exe 13136 Console 2 8,596 K StartMenuExperienceHost.e 12808 Console 2 25,048 K StSess.exe 13888 Console 2 7,072 K RuntimeBroker.exe 10136 Console 2 9,900 K SearchApp.exe 6424 Console 2 118,648 K RuntimeBroker.exe 11444 Console 2 9,624 K SkypeBackgroundHost.exe 14464 Console 2 5,184 K SkypeApp.exe 14496 Console 2 95,716 K LockApp.exe 14644 Console 2 7,148 K RuntimeBroker.exe 14808 Console 2 9,008 K StSess32.exe 15156 Console 2 2,788 K RuntimeBroker.exe 11080 Console 2 7,264 K RuntimeBroker.exe 15432 Console 2 8,796 K SecurityHealthSystray.exe 15560 Console 2 6,976 K OneDrive.exe 16048 Console 2 21,184 K ShellExperienceHost.exe 16260 Console 2 23,260 K jusched.exe 16348 Console 2 3,396 K RuntimeBroker.exe 16288 Console 2 9,236 K SkypeBridge.exe 16672 Console 2 22,336 K TextInputHost.exe 17316 Console 2 12,560 K dllhost.exe 8900 Console 2 6,124 K KakaoTalk.exe 16528 Console 2 116,472 K msedge.exe 16804 Console 2 180,808 K dllhost.exe 17128 Console 2 5,492 K svchost.exe 9400 Console 2 6,012 K svchost.exe 11156 Services 0 6,232 K ApplicationFrameHost.exe 3572 Console 2 8,028 K jucheck.exe 14308 Console 2 4,544 K UserOOBEBroker.exe 12860 Console 2 7,132 K msedge.exe 15580 Console 2 154,940 K msedge.exe 16304 Console 2 61,860 K msedge.exe 9504 Console 2 11,652 K chrome.exe 15596 Console 2 86,588 K chrome.exe 9084 Console 2 5,744 K chrome.exe 9296 Console 2 67,316 K chrome.exe 1744 Console 2 17,320 K chrome.exe 9220 Console 2 7,936 K chrome.exe 10392 Console 2 48,676 K chrome.exe 12024 Console 2 12,752 K cmd.exe 9592 Console 2 3,928 K conhost.exe 15308 Console 2 19,360 K svchost.exe 12504 Services 0 10,836 K svchost.exe 16032 Services 0 7,472 K Microsoft.Photos.exe 15568 Console 2 15,896 K svchost.exe 17512 Services 0 8,492 K svchost.exe 18828 Services 0 6,504 K RuntimeBroker.exe 18480 Console 2 14,728 K VSSVC.exe 9000 Services 0 9,968 K svchost.exe 17696 Services 0 9,140 K WmiPrvSE.exe 18916 Services 0 9,452 K svchost.exe 6240 Services 0 12,596 K backgroundTaskHost.exe 17640 Console 2 27,112 K RuntimeBroker.exe 18476 Console 2 21,824 K TrustedInstaller.exe 11364 Services 0 7,856 K svchost.exe 10780 Services 0 7,772 K svchost.exe 18036 Services 0 8,288 K smartscreen.exe 7556 Console 2 9,196 K svchost.exe 8056 Services 0 8,248 K tasklist.exe 2824 Console 2 9,528 K WmiPrvSE.exe 6368 Services 0 9,972 K
이미지 이름 PID 세션 이름 세션# 메모리 사용 ========================= ======== ================ =========== ============ System Idle Process 0 Services 0 8 K services.exe 892 Services 0 7,948 K wininit.exe 668 Services 0 4,140 K
wmic process where name="services.exe" get processid, parentprocessid, commandline C:\Users>wmic process where name="services.exe" get processid, parentprocessid, commandline CommandLine ParentProcessId ProcessId 668 892
wmic process where name="wininit.exe" get processid, parentprocessid, commandline C:\Users>wmic process where name="wininit.exe" get processid, parentprocessid, commandline CommandLine ParentProcessId ProcessId 552 668
C:\Users>
C:\Users>wmic process where name="System Idle Process" get processid, parentprocessid, commandline CommandLine ParentProcessId ProcessId 0 0
C:\Users>
taskkill /T /PID 21303 -> PID가 21303인 프로세스와 그 자식 프로세스 까지 종료
taskkill /T /PID 0 C:\Windows\system32>taskkill /T /PID 0 오류: PID 56인 프로세스(PID 4인 자식 프로세스)를 종료할 수 없습니다. 원인: 액세스가 거부되었습니다. 오류: PID 112인 프로세스(PID 4인 자식 프로세스)를 종료할 수 없습니다. 원인: 액세스가 거부되었습니다. 오류: PID 396인 프로세스(PID 4인 자식 프로세스)를 종료할 수 없습니다. 원인: 이 프로세스는 중대한 시스템 프로세스입니다. Taskkill에서 이 프로세스를 종료할 수 없습니다. 오류: PID 2148인 프로세스(PID 4인 자식 프로세스)를 종료할 수 없습니다. 원인: 액세스가 거부되었습니다. 오류: PID 4인 프로세스(PID 0인 자식 프로세스)를 종료할 수 없습니다. 원인: 이 프로세스의 자식 프로세스가 하나 이상 실행되고 있습니다. 오류: PID 0인 프로세스(PID 0인 자식 프로세스)를 종료할 수 없습니다. 원인: 이 프로세스의 자식 프로세스가 하나 이상 실행되고 있습니다.
지정된 윈도우의 속성을 변경합니다. 이 함수로 지정된 기능을 32bit 값으로 메모리에 추가합니다. 이 함수는 SetWindowLongPtr 함수로 대체 되었습니다.32bit, 64bit와 호환됩니다. 사용법은 같습니다. 이 함수는 SetWindowPos함수를 호출할때까지 적용되지 않습니다.
hWnd 변경을 원하는 윈도우의 핸들
nIndex 어느 설정을 변경 할 것인지 정해진 상수로 넣어줍니다. GWL_STYLE - 새로운 윈도우 스타일을 설정합니다. GWL_EXSTYLE - 새로운 확장 윈도우 스타일을 설정합니다. GWL_HINSTANCE - 새 응용 프로그램 인스턴스 핸들을 설정합니다. GWL_ID - 하위 윈도우의 새 식별자를 설정합니다. 창은 최상위 창이 될수없습니다. GWL_USERDATA - 창과 관련된 사용자 데이터를 설정합니다. 이 값은 창을 만든 응용프로그램에서 사용하기 위한 값입니다. 초기 값은 0입니다. GWL_WNDPROC - 윈도우 프로시저의 새주소를 설정합니다. 창이 호출한 스레도와 동일한 프로세스에 속하지 않으면 이 값은 변경 할수 없습니다.
[Git] push 명령어로 local 변경 사항 원격 저장소에 반영하기 [Git] push 명령어로 local 변경 사항 원격 저장소에 반영하기 [Git] push 명령어로 local 변경 사항 원격 저장소에 반영하기 [Git] push 명령어로 local 변경 사항 원격 저장소에 반영하기 [Git] push 명령어로 local 변경 사항 원격 저장소에 반영하기
- git commit과 push의 차이점 이해하기 - git commit과 push의 차이점 이해하기 - git commit과 push의 차이점 이해하기
그렇다면 git commit과 push의 차이는 뭘까? 그렇다면 git commit과 push의 차이는 뭘까? 그렇다면 git commit과 push의 차이는 뭘까?
git commit만으로는 왜 원격 저장소에 반영이 안될까? git commit만으로는 왜 원격 저장소에 반영이 안될까? git commit만으로는 왜 원격 저장소에 반영이 안될까?
우리가 데이터를 변경한 후 commit을 하면 그 내역은 로컬 저장소에 반영이 된다. 우리가 데이터를 변경한 후 commit을 하면 그 내역은 로컬 저장소에 반영이 된다. 우리가 데이터를 변경한 후 commit을 하면 그 내역은 로컬 저장소에 반영이 된다. 즉, 내 pc 내의 저장소에만 반영이 된 것이다. 즉, 내 pc 내의 저장소에만 반영이 된 것이다. 즉, 내 pc 내의 저장소에만 반영이 된 것이다.
로컬저장소에 반영된 변경 사항을 원격에도 반영하기 위한 도구가 push다. 로컬저장소에 반영된 변경 사항을 원격에도 반영하기 위한 도구가 push다. 로컬저장소에 반영된 변경 사항을 원격에도 반영하기 위한 도구가 push다.
commit한 내역을 push하게 되면, 이제 원격 저장소에도 그 내역이 업데이트 되는 것이다. commit한 내역을 push하게 되면, 이제 원격 저장소에도 그 내역이 업데이트 되는 것이다. commit한 내역을 push하게 되면, 이제 원격 저장소에도 그 내역이 업데이트 되는 것이다.
따라서, commit은 내 pc 내의 작업이 때문에 크게 위험하지 않다. 따라서, commit은 내 pc 내의 작업이 때문에 크게 위험하지 않다. 따라서, commit은 내 pc 내의 작업이 때문에 크게 위험하지 않다.
하지만 push는 원격 저장소, 즉 공동으로 작업하는 프로젝트에 (개인 프로젝트일 수도 있지만) 하지만 push는 원격 저장소, 즉 공동으로 작업하는 프로젝트에 (개인 프로젝트일 수도 있지만) 하지만 push는 원격 저장소, 즉 공동으로 작업하는 프로젝트에 (개인 프로젝트일 수도 있지만)
그 내역이 반영되는 것이기 때문에 신중하게 해야한다. 그 내역이 반영되는 것이기 때문에 신중하게 해야한다. 그 내역이 반영되는 것이기 때문에 신중하게 해야한다.
class Program { public static void Main(string[] args) { CHKNM nmm = new CHKNM(); nmm.RUN(); } } class CHKNM { //Console Width, Heigth int width = 0; int height = 0;
//Math.Cos,Math.Sin's Value to mapping Console Screen Size double mapx = 0.0; double mapy = 0.0;
int toggle = 0; int nextxpos = 0;
int end_degree_value = 360 * 2;
public void RUN() { width = Console.WindowWidth; height = Console.WindowHeight;
//Dynamic array index possible int[,] screenposition = new int[width,height];
# visual studio offline 2019가 이미 설치되어져 있다. #visual studio offline 2022를 동시에 설치한다.
- 현재 장비에 인터넷은 되지 않는다. 통합설치는 불가능하고, 개별설치로 2019를 설치해서 사용중이다. - 어찌 어찌 visual studio offline 2019 버젼을 설치해서 소스코드를 빌드해서 사용중이다. - 이제 visual studio offline 2022버젼을 설치해야 한다. 물론 이것도 개별설치로 진행해야 할것이다. 통합설치는 불가능.
- (참고문헌의 예) - (99.9) Visual Studio(2019) 설치 관리자를 엽니다. 제품 카드에서 기타 단추를 선택한 후 구성 내보내기를 선택합니다.
- Visual studio offline 2022버젼 binary 폴더로 이동한다. - (99.9)의 내용을 d:\tmp\memo\myconfig.vsconfig로 저장한다. - 아래의 shell을 실행한다. - vs_setup.exe --config d:\tmp\memo\myconfig.vsconfig - 실행결과 (?) - InstallerProjects2022.visx 확장프로그램 더블클릭시에, 자동실행 - Visual Studio 2022에 확장 이식가능. - Visual Studio 2019는 InstallerProjects.visx로 해야한다. - 실행결과 (?)