diff --git a/kernel/kernel.h b/kernel/kernel.h index 70fa5f9..03e6479 100644 --- a/kernel/kernel.h +++ b/kernel/kernel.h @@ -191,9 +191,6 @@ extern "C" { #include #include -#define ARRAY_IMPLEMENTATION_ONLY -#include - #define SHARED_COMMON_WANT_ALL #include #include diff --git a/kernel/module.h b/kernel/module.h index 197397e..f13851a 100644 --- a/kernel/module.h +++ b/kernel/module.h @@ -60,6 +60,7 @@ extern EsHeap heapFixed; void *EsHeapAllocate(size_t size, bool zeroMemory, EsHeap *kernelHeap); void EsHeapFree(void *address, size_t expectedSize, EsHeap *kernelHeap); +void *EsHeapReallocate(void *oldAddress, size_t newAllocationSize, bool zeroNewSpace, EsHeap *_heap); // --------------------------------------------------------------------------------------------------------------- // Debug output. @@ -108,9 +109,11 @@ void KUnregisterMSI(uintptr_t tag); #ifndef K_IN_CORE_KERNEL #define SHARED_DEFINITIONS_ONLY +#define ARRAY_DEFINITIONS_ONLY #endif #include #include +#include uint32_t CalculateCRC32(const void *_buffer, size_t length, uint32_t carry); uint64_t CalculateCRC64(const void *_buffer, size_t length, uint64_t carry); @@ -387,10 +390,6 @@ void *MMMapShared(MMSpace *space, MMSharedRegion *sharedRegion, uintptr_t offset // Panics on failure. void MMCheckUnusable(uintptr_t physicalStart, size_t bytes); -#define ARRAY_DEFINITIONS_ONLY -#include -#undef ARRAY_DEFINITIONS_ONLY - typedef SimpleList MMObjectCacheItem; struct MMObjectCache { diff --git a/kernel/objects.cpp b/kernel/objects.cpp index d9c47d4..0992144 100644 --- a/kernel/objects.cpp +++ b/kernel/objects.cpp @@ -22,7 +22,7 @@ struct ConstantBuffer { struct Pipe { #define PIPE_READER (1) #define PIPE_WRITER (2) -#define PIPE_BUFFER_SIZE (K_PAGE_SIZE) +#define PIPE_BUFFER_SIZE (256) #define PIPE_CLOSED (0) volatile char buffer[PIPE_BUFFER_SIZE]; diff --git a/shared/array.cpp b/shared/array.cpp index 63865cf..a94cebb 100644 --- a/shared/array.cpp +++ b/shared/array.cpp @@ -2,8 +2,6 @@ // It is released under the terms of the MIT license -- see LICENSE.md. // Written by: nakst. -#ifndef ARRAY_IMPLEMENTATION_ONLY - struct _ArrayHeader { size_t length, allocated; }; @@ -88,8 +86,6 @@ struct Array { } }; -#endif - #ifndef ARRAY_DEFINITIONS_ONLY bool _ArrayMaybeInitialise(void **array, size_t itemSize, EsHeap *heap) { diff --git a/util/x11/build.sh b/util/x11/build.sh index 9f6cf8e..9ddf1ac 100755 --- a/util/x11/build.sh +++ b/util/x11/build.sh @@ -4,4 +4,4 @@ mkdir -p bin/include_x11 cp root/Applications/POSIX/include/essence.h bin/include_x11 cp root/Essence/Desktop.esx bin/bundle.dat ld -r -b binary -o bin/Object\ Files/bundle.o bin/bundle.dat -g++ -o bin/hello_x11 util/x11/platform.cpp $1 bin/Object\ Files/bundle.o -lfreetype -lharfbuzz -lX11 -pthread -g -fno-exceptions -Ibin/include_x11 -I. -I/usr/include/freetype2 -DNO_API_TABLE -DUSE_PLATFORM_HEAP -DUSE_FREETYPE_AND_HARFBUZZ -DUSE_STB_SPRINTF -D_start=_StartApplication -D_init=EsHeapValidate -DES_FORWARD -Wall -Wextra -Wno-empty-body -Wno-deprecated-declarations -Wno-unknown-pragmas -Wno-missing-field-initializers -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -fsanitize=address +g++ -o bin/hello_x11 util/x11/platform.cpp $1 bin/Object\ Files/bundle.o -lfreetype -lharfbuzz -lX11 -pthread -g -fno-exceptions -Ibin/include_x11 -I. -I/usr/include/freetype2 -DNO_API_TABLE -DUSE_PLATFORM_HEAP -DUSE_FREETYPE_AND_HARFBUZZ -DUSE_STB_SPRINTF -D_start=_StartApplication -D_init=EsHeapValidate -DES_FORWARD -DARRAY_DEFINITIONS_ONLY -Wall -Wextra -Wno-empty-body -Wno-deprecated-declarations -Wno-unknown-pragmas -Wno-missing-field-initializers -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -fsanitize=address diff --git a/util/x11/platform.cpp b/util/x11/platform.cpp index 3734424..92f75b0 100644 --- a/util/x11/platform.cpp +++ b/util/x11/platform.cpp @@ -2,6 +2,7 @@ #undef ES_FORWARD #define Font _Font #define _start _StartDesktop +#undef ARRAY_DEFINITIONS_ONLY #include #undef _start #undef Font