diff --git a/bin/meu_malloc.o b/bin/meu_malloc.o deleted file mode 100644 index 1efa1bd405d3b867004aff8b8761dd9b01b345f9..0000000000000000000000000000000000000000 Binary files a/bin/meu_malloc.o and /dev/null differ diff --git a/includes/meu_malloc.h b/includes/meu_malloc.h index 53a46152f3911e34605fb407a7e8b65b5b067688..18fba6b2b648f8cbf5dab1e3873f69733836ff78 100644 --- a/includes/meu_malloc.h +++ b/includes/meu_malloc.h @@ -1,18 +1,25 @@ #ifndef __MEU_MALLOC__ #define __MEU_MALLOC__ +//inicia o alocador chamando a brk e atribuindo um valor pre determinado void iniciaAlocador(); +//finaliza o alocador voltando a heap para o seu inicio void finalizaAlocador(); +//Pede mais espaco na heap ao sistema operacional quando necessario void aloca_espaco(int tam_alloc); +//Aloca o ponteiro na heap void* alocaMem(int tam_alloc); +//rearranja os elementos dentro da heap liberando espacos desnecessarios void arruma_heap(); +//libera o ponteiro da heap void liberaMem(void* bloco); +//escreve o estado atual da heap void print_mapa(); #endif \ No newline at end of file diff --git a/lib/libmeu_malloc.a b/lib/libmeu_malloc.a deleted file mode 100644 index 7acda28347d161f4c2d02e5220ed1e8c21b86684..0000000000000000000000000000000000000000 Binary files a/lib/libmeu_malloc.a and /dev/null differ diff --git a/makefile b/makefile index 99920b280c0085377e263b227ae1fd068902c8e6..5bd6fcce56b19aaa0192c55a28d93170ddd3b149 100644 --- a/makefile +++ b/makefile @@ -1,21 +1,22 @@ -###########COMPILADORES############## +############COMPILADORES############### GCC = gcc AR = ar AS = as -#########DIRETORIOS CRIADOS########### +##########DIRETORIOS CRIADOS########### INC=./includes SRC=./src BIN=./bin LIB=./lib +#################FLAGS################# LIBFLAGS=-lmeu_malloc -L$(LIB) INCFLAGS=-I$(INC) CFLAGS=-Wall -g -no-pie -fno-pie ARFLAGS=rcs -#LIGACOES +##############LIGACOES################# build: diretorios libmeu_malloc.a $(GCC) $(CFLAGS) $(INCFLAGS) $(SRC)/teste.c -o teste $(LIBFLAGS) @@ -25,6 +26,8 @@ libmeu_malloc.a: meu_malloc.o meu_malloc.o: $(AS) $(SRC)/meu_malloc.s -o $(BIN)/meu_malloc.o -g + +########CRICACAO DE DIRETORIOS######### diretorios: @echo "Criando Diretorios \n" @@ -36,6 +39,7 @@ diretorios: mkdir $(LIB); \ fi +####LIMPA OS DIRETORIOS E ARQUIVOS##### clean: @echo "Limpando Diretorios\n" diff --git a/src/meu_malloc.s b/src/meu_malloc.s index 4038e13f07fc1fbc10bef124f7899e38d81c27c8..950e382000c8d84071ccd45b9a720ba8f0c4c3ed 100644 --- a/src/meu_malloc.s +++ b/src/meu_malloc.s @@ -7,9 +7,7 @@ str4: .string "*" str5: .string "INICIANDO O ALOCADOR!\n" str6: .string "ENTRADA INVALIDA!\n" - pula_Linha: .string "\n" - - flag: .string "%d" + pula_Linha: .string "\n"# .section .bss .equ ALOCADOR, 1040 @@ -139,7 +137,6 @@ alocaMem: jmp fim_if_aloca_mem2 fim_if_aloca_mem2: jmp fim_while_aloca_mem - fim_if_while_aloca_mem: addq $16, 8(%rbx) movq 8(%rbx), %r10 @@ -241,10 +238,6 @@ print_mapa: jmp for_cabecalho fim_for_cabecalho: - movq $flag,%rdi - movq 8(%rbx),%rsi - call printf - cmpq $LIVRE, (%rbx) jne else_if_while movq $0, -8(%rbp) #i = 0 diff --git a/teste b/teste deleted file mode 100755 index df0132ad4d2865cb6d0e7bde28bb0d15e3072564..0000000000000000000000000000000000000000 Binary files a/teste and /dev/null differ