From b5c13fd8369d6600fe1b6507da9fe2ab3cadf38b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Ortega=20Froysa?= Date: Tue, 3 May 2022 14:06:05 +0200 Subject: [PATCH] Initial commit. --- .gitignore | 4 ++++ 00-const-vars/const.cpp | 9 +++++++++ 00-const-vars/no-const.cpp | 9 +++++++++ LICENSE | 24 ++++++++++++++++++++++++ Makefile | 11 +++++++++++ README.md | 18 ++++++++++++++++++ 6 files changed, 75 insertions(+) create mode 100644 .gitignore create mode 100644 00-const-vars/const.cpp create mode 100644 00-const-vars/no-const.cpp create mode 100644 LICENSE create mode 100644 Makefile create mode 100644 README.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c39bc2d --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +# ignore binaries +*.exe +# ignore object dumps +*.dump diff --git a/00-const-vars/const.cpp b/00-const-vars/const.cpp new file mode 100644 index 0000000..e5852ae --- /dev/null +++ b/00-const-vars/const.cpp @@ -0,0 +1,9 @@ +#include + +int main() +{ + const int num = 7; + int res = num + 4; + + return EXIT_SUCCESS; +} diff --git a/00-const-vars/no-const.cpp b/00-const-vars/no-const.cpp new file mode 100644 index 0000000..0d19856 --- /dev/null +++ b/00-const-vars/no-const.cpp @@ -0,0 +1,9 @@ +#include + +int main() +{ + int num = 7; + int res = num + 4; + + return EXIT_SUCCESS; +} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..68a49da --- /dev/null +++ b/LICENSE @@ -0,0 +1,24 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..cbff4b9 --- /dev/null +++ b/Makefile @@ -0,0 +1,11 @@ +CPP=g++ + +EXEC := 00-const-vars/const.exe 00-const-vars/no-const.exe + +all: $(EXEC) + +%.exe: %.cpp + g++ $< -o $@ + +clean: + $(RM) $(EXEC) diff --git a/README.md b/README.md new file mode 100644 index 0000000..a642096 --- /dev/null +++ b/README.md @@ -0,0 +1,18 @@ +# C++ Optimization Video Resources + +This repository contains the resources I use for my C++ Optimization series on +my Odysee channel. + +## Building + +This project is composed of various small (useless) programs. The purpose is +primarily to analyze the code and resulting binary. You will require the GNU GCC +C++ compiler (`g++`) as well as the `objdump` program. After this, you can +compile all the projects by using GNU Make and simply running `make` from the +root directory of the project. + +## Copyright and License + +As educational resources, it is all licensed under the [Unlicense](/LICENSE). +You may freely use all content in this repository, but with no warranty nor +guarantee. I am not responsible for your usage of these resources.