forked from open-education-hub/operating-systems
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
asg/mem-alloc: Use doubly linked-list and update checker
Add a pointer to prev in struct block_meta and move unmodifiable files to utils/. Add memory leak checks and style checks to the checker. Add make check-fast option to skip checking for memory leaks. Add instructions for debugging with the VSCode debugger. Signed-off-by: Alex Apostolescu <[email protected]>
- Loading branch information
1 parent
144e22f
commit af257f6
Showing
96 changed files
with
3,520 additions
and
3,274 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
|
||
#include "osmem.h" | ||
#include "helpers.h" | ||
|
||
void *os_malloc(size_t size) | ||
{ | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,44 @@ | ||
SRC_PATH ?= ../src | ||
export SRC_PATH ?= $(realpath ../src) | ||
export UTILS_PATH ?= $(realpath ../utils) | ||
|
||
CC = gcc | ||
CPPFLAGS = -I../utils -I $(SRC_PATH) | ||
CPPFLAGS = -I$(UTILS_PATH) | ||
CFLAGS = -fPIC -Wall -Wextra -g | ||
LDFLAGS = -L$(SRC_PATH) | ||
LDLIBS = -losmem | ||
|
||
SOURCEDIR = src | ||
BUILDDIR = bin | ||
SRCS = $(sort $(wildcard $(SOURCEDIR)/*.c)) | ||
BINS = $(patsubst $(SOURCEDIR)/%.c, $(BUILDDIR)/%, $(SRCS)) | ||
SNIPPETS_SRC = $(sort $(wildcard snippets/*.c)) | ||
SNIPPETS = $(patsubst %.c,%,$(SNIPPETS_SRC)) | ||
|
||
.PHONY: all clean src check lint | ||
.PHONY: all src snippets clean_src clean_snippets check lint | ||
|
||
all: src $(BUILDDIR) $(BINS) | ||
all: src snippets | ||
|
||
$(BUILDDIR): | ||
mkdir -p $(BUILDDIR) | ||
src: | ||
$(MAKE) -C $(SRC_PATH) | ||
|
||
$(BUILDDIR)/%: $(SOURCEDIR)/%.c | ||
$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS) | ||
snippets: $(SNIPPETS) | ||
|
||
src: | ||
make -C $(SRC_PATH) | ||
clean_snippets: | ||
rm -rf $(SNIPPETS) | ||
|
||
clean_src: | ||
$(MAKE) -C $(SRC_PATH) clean | ||
|
||
check: | ||
make -C $(SRC_PATH) clean | ||
make clean | ||
make -i SRC_PATH=$(SRC_PATH) | ||
SRC_PATH=$(SRC_PATH) python checker.py | ||
$(MAKE) clean_src clean_snippets src snippets | ||
python run_tests.py | ||
|
||
check-fast: | ||
$(MAKE) clean_src clean_snippets src snippets | ||
python run-tests.py -d | ||
|
||
lint: | ||
-cd .. && checkpatch.pl -f src/*.c tests/src/*.c | ||
-cd .. && checkpatch.pl -f checker/*.sh | ||
-cd .. && cpplint --recursive src/ tests/ checker/ | ||
-cd .. && shellcheck checker/*.sh | ||
-cd .. && pylint tests/*.py | ||
# -cd .. && pylint tests/*.py | ||
|
||
clean: | ||
-rm -f *~ | ||
-rm -f $(BINS) | ||
snippets/%: snippets/%.c | ||
$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS) |
Oops, something went wrong.